getsentry / sentry-kubernetes

Kubernetes event reporter for Sentry
Apache License 2.0
458 stars 64 forks source link

fix: delayed detection of job ending for crons #69

Closed Jiahui-Zhang-20 closed 9 months ago

Jiahui-Zhang-20 commented 9 months ago

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, and failed 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.