gyfora commented on a change in pull request #131:
URL: 
https://github.com/apache/flink-kubernetes-operator/pull/131#discussion_r838511641



##########
File path: 
flink-kubernetes-operator/src/main/java/org/apache/flink/kubernetes/operator/controller/FlinkDeploymentController.java
##########
@@ -104,9 +105,31 @@ public DeleteControl cleanup(FlinkDeployment flinkApp, 
Context context) {
 
     @Override
     public UpdateControl<FlinkDeployment> reconcile(FlinkDeployment flinkApp, 
Context context) {
-        FlinkDeployment originalCopy = ReconciliationUtils.clone(flinkApp);
         LOG.info("Starting reconciliation");
+        FlinkDeployment originalCopy = ReconciliationUtils.clone(flinkApp);
+        FlinkDeploymentSpec lastReconciledSpec =
+                
flinkApp.getStatus().getReconciliationStatus().getLastReconciledSpec();
+        if (lastReconciledSpec != null) {
+            Configuration lastValidatedConfig =
+                    FlinkUtils.getEffectiveConfig(
+                            flinkApp.getMetadata(),
+                            lastReconciledSpec,
+                            defaultConfig.getFlinkConfig());
+            try {
+                observerFactory
+                        .getOrCreate(flinkApp)
+                        .observe(flinkApp, context, lastValidatedConfig);
+            } catch (DeploymentFailedException dfe) {

Review comment:
       We could also keep everything inside the original try-catch block and 
just do the validation there also. Maybe that will make it look nicer :) 




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


Reply via email to