gyfora commented on code in PR #283:
URL: 
https://github.com/apache/flink-kubernetes-operator/pull/283#discussion_r911746589


##########
flink-kubernetes-operator/src/main/java/org/apache/flink/kubernetes/operator/reconciler/deployment/AbstractFlinkResourceReconciler.java:
##########
@@ -99,15 +103,20 @@ public final void reconcile(CR cr, Context ctx) throws 
Exception {
         // No further logic is required at this point.
         if (firstDeployment) {
             LOG.info("Deploying for the first time");
+
+            // Before we try to submit the job we record the current spec in 
the status so we can
+            // handle subsequent deployment and status update errors
+            ReconciliationUtils.updateStatusBeforeDeploymentAttempt(cr, 
deployConfig);
+            statusRecorder.patchAndCacheStatus(cr);
+
             deploy(
                     cr,
                     spec,
                     status,
                     deployConfig,
                     
Optional.ofNullable(spec.getJob()).map(JobSpec::getInitialSavepointPath),
                     false);
-            ReconciliationUtils.updateForSpecReconciliationSuccess(
-                    cr, JobState.RUNNING, deployConfig);
+            ReconciliationUtils.updateStatusForDeployedSpec(cr, deployConfig);

Review Comment:
   I don't really understand why you say it doesnt work to handle first deploy 
errors.
   
   What will happen is:
    - Job goes into UPGRADING state
    - reconcileSpecCahnges is called
    - Job is deployed again
    
    You can manually verify this by compiling a version of the operator that 
throws an exception every time before or after the first deployment



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