diff --git a/dinky-client/dinky-client-1.18/src/main/java/org/apache/flink/kubernetes/KubernetesClusterDescriptor.java b/dinky-client/dinky-client-1.18/src/main/java/org/apache/flink/kubernetes/KubernetesClusterDescriptor.java index 41b782176a..27ed7870ae 100644 --- a/dinky-client/dinky-client-1.18/src/main/java/org/apache/flink/kubernetes/KubernetesClusterDescriptor.java +++ b/dinky-client/dinky-client-1.18/src/main/java/org/apache/flink/kubernetes/KubernetesClusterDescriptor.java @@ -171,7 +171,8 @@ public ClusterClientProvider deployApplicationCluster( throws ClusterDeploymentException { if (client.getService(ExternalServiceDecorator.getExternalServiceName(clusterId)) .isPresent()) { - throw new ClusterDeploymentException("The Flink cluster " + clusterId + " already exists."); + client.stopAndCleanupCluster(clusterId); + LOG.warn("The Flink cluster {} already exists, automatically stopAndCleanupCluster.", clusterId); } checkNotNull(clusterSpecification);