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


##########
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:
   Also I would note that this only happens if what the user requested in the 
spec cannot be applied directly but we apply an allowed but different upgrade 
mode instead . It would be strange if this was not reflected in the status and 
would make it difficult to build some feature that require knowing what 
actually was done during last upgrade 



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