Miuler commented on code in PR #252:
URL:
https://github.com/apache/flink-kubernetes-operator/pull/252#discussion_r888884192
##########
flink-kubernetes-operator/src/main/java/org/apache/flink/kubernetes/operator/service/FlinkService.java:
##########
@@ -354,8 +355,54 @@ protected ClusterClient<String>
getClusterClient(Configuration config) throws Ex
}
public void cancelJob(FlinkDeployment deployment, UpgradeMode upgradeMode)
throws Exception {
- var conf = configManager.getObserveConfig(deployment);
- var deploymentStatus = deployment.getStatus();
+ Optional<String> savepointOpt = Optional.empty();
+
+ Configuration conf = null;
+ FlinkDeploymentStatus deploymentStatus = deployment.getStatus();
+ try {
+ conf = configManager.getObserveConfig(deployment);
+ savepointOpt = cancelJob(deployment, upgradeMode, conf,
deploymentStatus);
+ } catch (LastReconciledSpecException e) {
+ LOG.warn("Last reconciled spec is null", e);
+ }
+
+ switch (upgradeMode) {
Review Comment:
The method would be enormous. It seemed like a good practice to me to
separate the behavior of deleting the cluster using the flink client and, on
the other hand, deleting the kubernetes deployment. At first it is more
complicated but then it becomes easier to read
--
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]