wangyang0918 commented on a change in pull request #13644:
URL: https://github.com/apache/flink/pull/13644#discussion_r506243026



##########
File path: 
flink-kubernetes/src/main/java/org/apache/flink/kubernetes/kubeclient/Fabric8FlinkKubeClient.java
##########
@@ -219,6 +230,68 @@ public KubernetesWatch watchPodsAndDoCallback(
                                .watch(new 
KubernetesPodsWatcher(podCallbackHandler)));
        }
 
+       @Override
+       public CompletableFuture<Void> createConfigMap(KubernetesConfigMap 
configMap) {
+               return CompletableFuture.runAsync(
+                       () -> {
+                               if 
(!getConfigMap(configMap.getName()).isPresent()) {
+                                       
this.internalClient.configMaps().create(configMap.getInternalResource());
+                               }

Review comment:
       If the ConfigMap already exists, the create operation will fail. Since 
the check-and-create is not an atomic operation, I will use a `try... catch` to 
directly creating the ConfigMap.




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

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


Reply via email to