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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]