Skip to content

Commit e147974

Browse files
authored
Revert jobsubmitterfailed status and keep exitCode field (#427)
* Fix job state based on jobSubmitter exitCode * Removed new JobStatus to keep things simple
1 parent 80d0754 commit e147974

File tree

4 files changed

+13
-17
lines changed

4 files changed

+13
-17
lines changed

apis/flinkcluster/v1beta1/flinkcluster_types.go

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -52,18 +52,17 @@ type JobMode string
5252

5353
// JobState defines states for a Flink job deployment.
5454
const (
55-
JobStatePending = "Pending"
56-
JobStateUpdating = "Updating"
57-
JobStateRestarting = "Restarting"
58-
JobStateDeploying = "Deploying"
59-
JobStateDeployFailed = "DeployFailed"
60-
JobStateSubmitterFailed = "SubmitterFailed"
61-
JobStateRunning = "Running"
62-
JobStateSucceeded = "Succeeded"
63-
JobStateCancelled = "Cancelled"
64-
JobStateFailed = "Failed"
65-
JobStateLost = "Lost"
66-
JobStateUnknown = "Unknown"
55+
JobStatePending = "Pending"
56+
JobStateUpdating = "Updating"
57+
JobStateRestarting = "Restarting"
58+
JobStateDeploying = "Deploying"
59+
JobStateDeployFailed = "DeployFailed"
60+
JobStateRunning = "Running"
61+
JobStateSucceeded = "Succeeded"
62+
JobStateCancelled = "Cancelled"
63+
JobStateFailed = "Failed"
64+
JobStateLost = "Lost"
65+
JobStateUnknown = "Unknown"
6766
)
6867

6968
// AccessScope defines the access scope of JobManager service.

apis/flinkcluster/v1beta1/flinkcluster_types_util.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@ func (j *JobStatus) IsFailed() bool {
2222
return j != nil &&
2323
(j.State == JobStateFailed ||
2424
j.State == JobStateLost ||
25-
j.State == JobStateDeployFailed ||
26-
j.State == JobStateSubmitterFailed)
25+
j.State == JobStateDeployFailed)
2726
}
2827

2928
func (j *JobStatus) IsStopped() bool {

controllers/flinkcluster/flinkcluster_converter.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1065,7 +1065,7 @@ func shouldCleanup(cluster *v1beta1.FlinkCluster, component string) bool {
10651065
switch jobStatus.State {
10661066
case v1beta1.JobStateSucceeded:
10671067
action = cluster.Spec.Job.CleanupPolicy.AfterJobSucceeds
1068-
case v1beta1.JobStateFailed, v1beta1.JobStateLost, v1beta1.JobStateDeployFailed, v1beta1.JobStateSubmitterFailed:
1068+
case v1beta1.JobStateFailed, v1beta1.JobStateLost, v1beta1.JobStateDeployFailed:
10691069
action = cluster.Spec.Job.CleanupPolicy.AfterJobFails
10701070
case v1beta1.JobStateCancelled:
10711071
action = cluster.Spec.Job.CleanupPolicy.AfterJobCancelled

controllers/flinkcluster/flinkcluster_updater.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -620,8 +620,6 @@ func (updater *ClusterStatusUpdater) deriveJobStatus() *v1beta1.JobStatus {
620620
switch {
621621
case oldJob == nil:
622622
newJobState = v1beta1.JobStatePending
623-
case oldJob.SubmitterExitCode != newJob.SubmitterExitCode && isNonZeroExitCode(newJob.SubmitterExitCode):
624-
newJobState = v1beta1.JobStateSubmitterFailed
625623
case shouldUpdateJob(&observed):
626624
newJobState = v1beta1.JobStateUpdating
627625
case oldJob.ShouldRestart(jobSpec):

0 commit comments

Comments
 (0)