Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add new status conditions for k8s v1.31 #403

Merged
merged 4 commits into from
Oct 28, 2024

Conversation

afdesk
Copy link
Contributor

@afdesk afdesk commented Oct 15, 2024

In Kubernetes v1.31.* the diagram of transitions looks like below.
so we can complete the job after the first success, but we should wait for all pods are terminated.

the docs: Transition of "status.conditions"

@afdesk afdesk marked this pull request as ready for review October 15, 2024 12:09
case batchv1.JobComplete, batchv1.JobSuccessCriteriaMet:
complete <- nil
return
case batchv1.JobFailed:

Choose a reason for hiding this comment

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

Should we also check the JobFailureTarget condition?
From the doc:

You can use the FailureTarget or the SuccessCriteriaMet condition to evaluate whether the Job has failed or succeeded without having to wait for the controller to add a terminal condition.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good catch! I thought about it, but decided to wait for JobFailed. that means all pods are terminated.
to avoid an error aquasecurity/trivy#5639

wdyt?

Choose a reason for hiding this comment

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

Thank you, that makes sense.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

thank you!

@afdesk afdesk merged commit b6099eb into aquasecurity:main Oct 28, 2024
4 checks passed
@afdesk afdesk deleted the fix/status-for-v1-31 branch October 28, 2024 10:09
@afdesk afdesk restored the fix/status-for-v1-31 branch October 29, 2024 05:08
@afdesk afdesk deleted the fix/status-for-v1-31 branch October 29, 2024 05:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants