You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by GitBox <gi...@apache.org> on 2022/03/27 08:23:17 UTC

[GitHub] [flink-kubernetes-operator] gyfora commented on a change in pull request #85: [FLINK-26538] Add ability to restart flink deployment

gyfora commented on a change in pull request #85:
URL: https://github.com/apache/flink-kubernetes-operator/pull/85#discussion_r835870649



##########
File path: flink-kubernetes-operator/src/main/java/org/apache/flink/kubernetes/operator/validation/DefaultDeploymentValidator.java
##########
@@ -245,6 +241,19 @@
 
         JobSpec oldJob = oldSpec.getJob();
         JobSpec newJob = newSpec.getJob();
+
+        if (lastReconciledSpec(deployment) != null
+                && ReconciliationUtils.triggerRestart(deployment)) {
+            if (newJob.getState() != JobState.RUNNING) {
+                return Optional.of(
+                        String.format("Cannot restart job to %s state", newJob.getState()));
+            }
+            if (oldJob.getState() != JobState.RUNNING) {
+                return Optional.of(
+                        String.format("Cannot restart job in %s state", oldJob.getState()));
+            }
+        }

Review comment:
       I think we can remove these checks together with the `ReconciliationUtils.triggerRestart(deployment))` I dont think we are achieving anything and we actually restrict cases when the user want to restart a failing job




-- 
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: commits-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org