gyfora commented on code in PR #1248:
URL: 
https://github.com/apache/flink-kubernetes-operator/pull/1248#discussion_r4720540963


##########
flink-kubernetes-operator/src/main/java/org/apache/flink/kubernetes/operator/controller/FlinkSessionJobController.java:
##########
@@ -134,14 +134,19 @@ public DeleteControl cleanup(FlinkSessionJob sessionJob, 
Context josdkContext) {
         if (canaryResourceManager.handleCanaryResourceDeletion(sessionJob)) {
             return DeleteControl.defaultDelete();
         }
+        statusRecorder.updateStatusFromCache(sessionJob);
+        if 
(sessionJob.getStatus().getReconciliationStatus().isBeforeFirstDeployment()) {
+            LOG.info("Nothing was deployed yet, nothing to clean up");
+            onCleanupFinished(sessionJob);
+            return DeleteControl.defaultDelete();
+        }
         eventRecorder.triggerEvent(
                 sessionJob,
                 EventRecorder.Type.Normal,
                 EventRecorder.Reason.Cleanup,
                 EventRecorder.Component.Operator,
                 "Cleaning up FlinkSessionJob",
                 josdkContext.getClient());
-        statusRecorder.updateStatusFromCache(sessionJob);

Review Comment:
   just moved it earlier



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

Reply via email to