diff --git a/backend/src/main/java/com/qqchen/deploy/backend/deploy/integration/impl/K8sServiceIntegrationImpl.java b/backend/src/main/java/com/qqchen/deploy/backend/deploy/integration/impl/K8sServiceIntegrationImpl.java index c78fc129..d593d279 100644 --- a/backend/src/main/java/com/qqchen/deploy/backend/deploy/integration/impl/K8sServiceIntegrationImpl.java +++ b/backend/src/main/java/com/qqchen/deploy/backend/deploy/integration/impl/K8sServiceIntegrationImpl.java @@ -662,11 +662,11 @@ public class K8sServiceIntegrationImpl extends BaseExternalSystemIntegration imp timestamp ); - // 使用strategic merge patch更新Deployment,明确指定patch类型 + // 使用strategic merge patch更新Deployment api.patchNamespacedDeployment( deploymentName, namespace, - new io.kubernetes.client.custom.V1Patch(patchBody, io.kubernetes.client.custom.V1Patch.PATCH_FORMAT_STRATEGIC_MERGE_PATCH), + new io.kubernetes.client.custom.V1Patch(patchBody), null, null, null, @@ -706,11 +706,11 @@ public class K8sServiceIntegrationImpl extends BaseExternalSystemIntegration imp // 构建patch内容:更新spec.replicas String patchBody = String.format("{\"spec\":{\"replicas\":%d}}", replicas); - // 使用strategic merge patch更新Deployment的scale,明确指定patch类型 + // 使用strategic merge patch更新Deployment的scale api.patchNamespacedDeploymentScale( deploymentName, namespace, - new io.kubernetes.client.custom.V1Patch(patchBody, io.kubernetes.client.custom.V1Patch.PATCH_FORMAT_STRATEGIC_MERGE_PATCH), + new io.kubernetes.client.custom.V1Patch(patchBody), null, null, null,