mateczagany commented on code in PR #791:
URL: 
https://github.com/apache/flink-kubernetes-operator/pull/791#discussion_r1518292007


##########
flink-kubernetes-operator/src/main/java/org/apache/flink/kubernetes/operator/service/NativeFlinkService.java:
##########
@@ -356,4 +353,32 @@ public boolean scalingCompleted(FlinkResourceContext<?> 
ctx) {
             throw new RuntimeException(e);
         }
     }
+
+    private long scaleJmToZero(
+            EditReplacePatchable<Deployment> jmDeployment,
+            String namespace,
+            String clusterId,
+            long timeoutMillis) {
+        LOG.info("Scaling down JobManager Deployment to zero before deletion");
+        long startTime = System.currentTimeMillis();
+        try {
+            // We use patching instead of scaling to avoid the need for new 
permissions
+            var patch = new 
DeploymentBuilder().editOrNewSpec().withReplicas(0).endSpec().build();
+            jmDeployment.patch(PatchContext.of(PatchType.JSON_MERGE), patch);
+            kubernetesClient
+                    .pods()
+                    .inNamespace(namespace)
+                    
.withLabels(KubernetesUtils.getJobManagerSelectors(clusterId))
+                    .waitUntilCondition(
+                            Objects::isNull,
+                            
operatorConfig.getFlinkShutdownClusterTimeout().getSeconds(),

Review Comment:
   I think this should be `timeoutMillis`



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to