fix: delayed detection of job ending for crons #69
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Previously:
The job informer relied on the number of successful pods to be correct or a failed pod to be present in the job object to checkin at the end of a job. This did not send the event within the expected time durations.
Moreover, whether a checkin is the beginning or end of a job was determined by the type of event handler, which was incorrect, since a job did not necessarily get deleted when it was either completed or failed.
Now:
The function triggered by the event handler looks at the number of
active
pods,successful
pods, andfailed
pods to determine whether the job just begun, is still in progress, or have ended.Also, the status of a job after ending is determined by the
Conditions
slice in the job status struct.