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

Feat: add failed jobs as unused #283

Merged
merged 13 commits into from
May 23, 2024
Merged

Feat: add failed jobs as unused #283

merged 13 commits into from
May 23, 2024

Conversation

yonahd
Copy link
Owner

@yonahd yonahd commented May 22, 2024

This PR adds a case where A Job has failed and reached it's maximum retries.
This pod should now be considered unused

What this PR does / why we need it?

PR Checklist

  • This PR adds K8s exceptions (false positives)
  • This PR adds new code
  • This PR includes tests for new/existing code
  • This PR adds docs

@codecov-commenter
Copy link

codecov-commenter commented May 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 40.96%. Comparing base (710239d) to head (72e1cab).
Report is 3 commits behind head on main.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #283      +/-   ##
==========================================
+ Coverage   40.84%   40.96%   +0.12%     
==========================================
  Files          58       58              
  Lines        2904     2910       +6     
==========================================
+ Hits         1186     1192       +6     
  Misses       1530     1530              
  Partials      188      188              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@doronkg
Copy link
Contributor

doronkg commented May 23, 2024

Left small suggestion. Few thoughts, as we're shifting the way we approach unused Jobs from just completed ones:

  1. If adding failures as an indication for unused, let's add another condition for DeadlineExceeded.
  2. We can also consider checking FailedIndexes which is another type of BackoffLimit.
  3. What about suspended Jobs?

pkg/kor/jobs.go Outdated Show resolved Hide resolved
pkg/kor/jobs_test.go Outdated Show resolved Hide resolved
pkg/kor/jobs_test.go Outdated Show resolved Hide resolved
@yonahd yonahd merged commit 852a6f9 into main May 23, 2024
1 check passed
@yonahd yonahd deleted the yonahd-patch-1 branch May 23, 2024 16:16
@doronkg doronkg mentioned this pull request Jun 7, 2024
4 tasks
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.

None yet

3 participants