gyfora commented on code in PR #1232:
URL: 
https://github.com/apache/flink-kubernetes-operator/pull/1232#discussion_r4443752312


##########
flink-kubernetes-operator/src/main/java/org/apache/flink/kubernetes/operator/service/AbstractFlinkService.java:
##########
@@ -1243,6 +1247,74 @@ private static Configuration 
getOperatorRestConfig(Configuration origConfig)
         return conf;
     }
 
+    @VisibleForTesting
+    protected void forceDeleteStuckPods(Map<String, String> labels, Deployment 
deployment) {
+        var now = Instant.now();
+        var stuckPods =
+                kubernetesClient
+                        .pods()
+                        .inNamespace(deployment.getMetadata().getNamespace())
+                        .withLabels(labels)
+                        .list()
+                        .getItems()
+                        .stream()
+                        .filter(pod -> isPastDeletionDeadline(pod, now))
+                        .collect(Collectors.toList());
+        stuckPods.forEach(pod -> 
kubernetesClient.resource(pod).withGracePeriod(0).delete());

Review Comment:
   If something adds finalizers, there could be a good reason not to remove 
those . Keeping this simple for now



-- 
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