X Tutup
Skip to content

Commit 84cc9cc

Browse files
committed
fix : let scale support StatefulSet
1 parent f5efa47 commit 84cc9cc

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

extended/src/main/java/io/kubernetes/client/extended/kubectl/KubectlScale.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import io.kubernetes.client.openapi.apis.AppsV1Api;
2020
import io.kubernetes.client.openapi.models.V1Deployment;
2121
import io.kubernetes.client.openapi.models.V1ReplicaSet;
22+
import io.kubernetes.client.openapi.models.V1StatefulSet;
2223
import io.kubernetes.client.util.PatchUtils;
2324

2425
public class KubectlScale<ApiType extends KubernetesObject>
@@ -68,6 +69,14 @@ public ApiType execute() throws KubectlException {
6869
name, namespace, new V1Patch(jsonPatchStr), null, null, null, null, null),
6970
V1Patch.PATCH_FORMAT_JSON_PATCH,
7071
this.apiClient);
72+
} else if (apiTypeClass.equals(V1StatefulSet.class)) {
73+
return PatchUtils.patch(
74+
apiTypeClass,
75+
() ->
76+
api.patchNamespacedStatefulSetCall(
77+
name, namespace, new V1Patch(jsonPatchStr), null, null, null, null, null),
78+
V1Patch.PATCH_FORMAT_JSON_PATCH,
79+
this.apiClient);
7180
} else {
7281
throw new KubectlException("Unsupported class for scale: " + apiTypeClass);
7382
}

0 commit comments

Comments
 (0)
X Tutup