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


##########
flink-kubernetes-operator/src/main/java/org/apache/flink/kubernetes/operator/reconciler/deployment/AbstractFlinkResourceReconciler.java:
##########
@@ -116,9 +119,23 @@ public final void reconcile(CR cr, Context<?> ctx) throws 
Exception {
         if (reconciliationStatus.isBeforeFirstDeployment()) {
             LOG.info("Deploying for the first time");
 
+            if (spec.getJob() != null) {
+                var initialUpgradeMode = UpgradeMode.STATELESS;
+                var initialSp = spec.getJob().getInitialSavepointPath();
+
+                if (initialSp != null) {
+                    status.getJobStatus()
+                            .getSavepointInfo()
+                            .setLastSavepoint(
+                                    Savepoint.of(initialSp, 
SavepointTriggerType.UNKNOWN));
+                    initialUpgradeMode = UpgradeMode.SAVEPOINT;
+                }
+
+                spec.getJob().setUpgradeMode(initialUpgradeMode);

Review Comment:
   We already store modified versions of the spec as the operator reconciles 
the resource. We had similar logic already during suspend/ upgrade/savepoints 
etc.
   
   this is not a problem because we do not use a naive equality check to test 
whether user requested changes have been applied. But instead we determine the 
diff and ignore changes that do not result in an upgrade but only affect 
reconciliation (such as upgrade mode and operator configs)
   
   Since this is already done and works without any issues and is actually a 
very clean solution I would suggest we not change it.



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