wangyang0918 commented on code in PR #195:
URL: 
https://github.com/apache/flink-kubernetes-operator/pull/195#discussion_r866948431


##########
flink-kubernetes-operator/src/main/java/org/apache/flink/kubernetes/operator/config/FlinkConfigBuilder.java:
##########
@@ -112,30 +132,31 @@ protected FlinkConfigBuilder applyFlinkConfiguration() {
         }
 
         // Adapt default rest service type from 1.15+
-        if (!effectiveConfig.contains(REST_SERVICE_EXPOSED_TYPE)) {
-            effectiveConfig.set(
-                    REST_SERVICE_EXPOSED_TYPE,
-                    KubernetesConfigOptions.ServiceExposedType.ClusterIP);
-        }
+        setDefaultConf(
+                REST_SERVICE_EXPOSED_TYPE, 
KubernetesConfigOptions.ServiceExposedType.ClusterIP);
 
         if (spec.getJob() != null) {
-            if (!effectiveConfig.contains(CANCEL_ENABLE)) {
-                // Set 'web.cancel.enable' to false for application 
deployments to avoid users
-                // accidentally cancelling jobs.
-                effectiveConfig.set(CANCEL_ENABLE, false);
-            }
+            // Set 'web.cancel.enable' to false for application deployments to 
avoid users
+            // accidentally cancelling jobs.
+            setDefaultConf(CANCEL_ENABLE, false);
+
             // With last-state upgrade mode, set the default value of
             // 'execution.checkpointing.interval'
             // to 5 minutes when HA is enabled.
-            if (spec.getJob().getUpgradeMode() == UpgradeMode.LAST_STATE
-                    && !effectiveConfig.contains(
-                            
ExecutionCheckpointingOptions.CHECKPOINTING_INTERVAL)) {
-                effectiveConfig.set(
+            if (spec.getJob().getUpgradeMode() == UpgradeMode.LAST_STATE) {
+                setDefaultConf(
                         ExecutionCheckpointingOptions.CHECKPOINTING_INTERVAL,
                         DEFAULT_CHECKPOINTING_INTERVAL);
             }
+
+            // We need to keep the application clusters around for proper 
operator behaviour
+            effectiveConfig.set(SHUTDOWN_ON_APPLICATION_FINISH, false);
+            if 
(HighAvailabilityMode.isHighAvailabilityModeActivated(effectiveConfig)) {

Review Comment:
   I got it. Multiple jobs could be submitted when HA disabled.



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

Reply via email to