Aitozi commented on code in PR #181: URL: https://github.com/apache/flink-kubernetes-operator/pull/181#discussion_r857102946
########## flink-kubernetes-operator/src/main/java/org/apache/flink/kubernetes/operator/utils/FlinkUtils.java: ########## @@ -243,22 +244,21 @@ public static void deleteJobGraphInKubernetesHA( .withLabels(haConfigMapLabels) .list(); - configMaps - .getItems() - .forEach( - configMap -> { - final boolean isDeleted = - configMap - .getData() - .entrySet() - .removeIf(FlinkUtils::isJobGraphKey); - if (isDeleted) { - LOG.info( - "Job graph in ConfigMap {} is deleted", - configMap.getMetadata().getName()); - } - }); - kubernetesClient.resourceList(configMaps).inNamespace(namespace).createOrReplace(); + boolean shouldUpdate = false; + for (ConfigMap configMap : configMaps.getItems()) { + if (configMap.getData() == null || configMap.getData().isEmpty()) { + continue; + } + final boolean isDeleted = Review Comment: nit: It seems we can directly assign to `shouldUpdate` here ? -- 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: issues-unsubscr...@flink.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org