wangyang0918 commented on a change in pull request #19153:
URL: https://github.com/apache/flink/pull/19153#discussion_r830717092
##########
File path:
flink-kubernetes/src/main/java/org/apache/flink/kubernetes/kubeclient/Fabric8FlinkKubeClient.java
##########
@@ -350,14 +350,48 @@ public KubernetesLeaderElector createLeaderElector(
@Override
public CompletableFuture<Void> deleteConfigMapsByLabels(Map<String,
String> labels) {
return CompletableFuture.runAsync(
- () ->
this.internalClient.configMaps().withLabels(labels).delete(),
+ () -> {
+ if
(!this.internalClient.configMaps().withLabels(labels).delete()) {
Review comment:
It seems that Kubernetes APIServer is using
[go-rest](https://github.com/emicklei/go-restful) for rest handling. From the
[documentation](https://pkg.go.dev/github.com/emicklei/go-restful#hdr-Error_Handling),
the 404 will be returned if the path could not be found(e.g.
/api/v1/namespaces/test/configmaps/test-config-map).
So in the fabric8 K8s client implementation, only throwing exception
indicates that the deletion operation might fail. I am suggesting to add a
comment to explain why it could work 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]