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


##########
flink-kubernetes-operator/src/main/java/org/apache/flink/kubernetes/operator/reconciler/ReconciliationUtils.java:
##########
@@ -281,6 +284,17 @@ public static boolean 
isUpgradeModeChangedToLastStateAndHADisabledPreviously(
                 && 
!HighAvailabilityMode.isHighAvailabilityModeActivated(observeConfig);
     }
 
+    public static <SPEC extends AbstractFlinkSpec> SPEC getLastSpec(
+            AbstractFlinkResource<SPEC, ?> deployment) {
+        var reconciliationStatus = 
deployment.getStatus().getReconciliationStatus();
+        var reconciliationState = reconciliationStatus.getState();
+        if (reconciliationState != ReconciliationState.ROLLED_BACK) {
+            return reconciliationStatus.deserializeLastReconciledSpec();
+        } else {
+            return reconciliationStatus.deserializeLastRollbackSpec();

Review Comment:
   `lastReconciled` spec is not `current` spec. Current spec is already in the 
spec, lastReconciled is what was last reconciled by the operator based on what 
the user provided. Its sole purpose is to be able to do the above mentioned 
comparison. We should try not to change the semantics if possible.



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