gyfora commented on code in PR #252: URL: https://github.com/apache/flink-kubernetes-operator/pull/252#discussion_r888767237
########## 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: Could you please not refactor the method? Seems like a lot of unnecessary changes, it’s hard to see what actually changed in the logic -- 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