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/15 06:26:23 UTC

[GitHub] [flink-kubernetes-operator] gyfora commented on a change in pull request #58: [FLINK-26528] Trigger the updateControl only when the FlinkDeployment…

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



##########
File path: flink-kubernetes-operator/src/main/java/org/apache/flink/kubernetes/operator/observer/JobManagerDeploymentStatus.java
##########
@@ -45,7 +46,9 @@
     ERROR;
 
     public UpdateControl<FlinkDeployment> toUpdateControl(
-            FlinkDeployment flinkDeployment, FlinkOperatorConfiguration operatorConfiguration) {
+            FlinkDeployment originalCopy,

Review comment:
       Maybe instead of adding `originalCopy` here we could simply change this method to return the reschedule delay only. I think that would fit better in the current flow. Then we can use the `ReconciliationUtils.toUpdateControl` in the controller
   
   What do you think?

##########
File path: flink-kubernetes-operator/src/main/java/org/apache/flink/kubernetes/operator/exception/DeploymentFailedException.java
##########
@@ -26,6 +26,7 @@
 /** Exception to signal terminal deployment failure. */
 public class DeploymentFailedException extends RuntimeException {
     public static final String COMPONENT_JOBMANAGER = "JobManagerDeployment";
+    private static final long serialVersionUID = -1070179896083579221L;

Review comment:
       Why did you add the serialVersionUIDs?

##########
File path: flink-kubernetes-operator/src/main/java/org/apache/flink/kubernetes/operator/reconciler/ReconciliationUtils.java
##########
@@ -74,4 +77,22 @@ public static void updateForReconciliationError(FlinkDeployment flinkApp, String
             throw new IllegalStateException(e);
         }
     }
+
+    public static UpdateControl<FlinkDeployment> toUpdateControl(
+            FlinkDeployment originalCopy, FlinkDeployment current) {
+        UpdateControl<FlinkDeployment> updateControl;
+        if (!Objects.equals(originalCopy.getSpec(), current.getSpec())) {
+            throw new UnsupportedOperationException(
+                    "The spec changed during reconcile is not supported.");

Review comment:
       I think this is a valid safeguard but I think the error should be something like:
   ```
   Detected spec change after reconcile, this probably indicates a bug.
   ```




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