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


##########
flink-kubernetes-operator/src/main/java/org/apache/flink/kubernetes/operator/observer/deployment/AbstractDeploymentObserver.java:
##########
@@ -159,16 +185,18 @@ private void checkCrashLoopBackoff(FlinkDeployment 
flinkApp, Configuration effec
         }
     }
 
-    protected boolean isClusterReady(FlinkDeployment dep) {
+    protected boolean isJmDeploymentReady(FlinkDeployment dep) {
         return dep.getStatus().getJobManagerDeploymentStatus() == 
JobManagerDeploymentStatus.READY;
     }
 
     protected void 
clearErrorsIfJobManagerDeploymentNotInErrorStatus(FlinkDeployment dep) {
-        if (dep.getStatus().getJobManagerDeploymentStatus() != 
JobManagerDeploymentStatus.ERROR) {
-            final ReconciliationStatus reconciliationStatus =
-                    dep.getStatus().getReconciliationStatus();
-            reconciliationStatus.setSuccess(true);
-            reconciliationStatus.setError(null);
+        FlinkDeploymentStatus status = dep.getStatus();
+        ReconciliationStatus reconciliationStatus = 
status.getReconciliationStatus();
+        if (status.getJobManagerDeploymentStatus() != 
JobManagerDeploymentStatus.ERROR
+                && reconciliationStatus
+                        .getLastReconciledSpec()
+                        .equals(reconciliationStatus.getLastStableSpec())) {

Review Comment:
   The intention here was to avoid losing error information that caused a 
rollback operation thats why I introduced the additional isStable check. I have 
now updated the method name to: `clearErrorsIfDeploymentIsHealthy` that is more 
appropriate 



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