Skip to content
This repository has been archived by the owner on Jan 8, 2024. It is now read-only.

Bug fix: Patch k8s stop task to only delete the job if it had pending pods #3299

Merged
merged 2 commits into from
Apr 29, 2022

Conversation

catsby
Copy link
Contributor

@catsby catsby commented Apr 28, 2022

#3143 introduced changes to remove pods/jobs if any of the pods were stuck in pending. As written it unintentionally introduced a bug where no pods were getting automatically cleaned up, because we always destroyed the job when StopTask was called. This prevented the auto cleanup of pods via the TTLSecondsAfterFinished setting in the job spec.

In this PR we only destroy the job if it has any pods stuck in pending, otherwise we let Kubernetes clean things up when the TTL expires.

@catsby catsby added plugin/k8s pr/no-changelog No automatic changelog entry required for this pull request backport/0.8.x labels Apr 28, 2022
@catsby catsby removed the pr/no-changelog No automatic changelog entry required for this pull request label Apr 28, 2022
@catsby catsby requested a review from a team April 28, 2022 22:17
Copy link
Member

@briancain briancain left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, nice find 👍🏻

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants