yonahd / kor

A Golang Tool to discover unused Kubernetes Resources
MIT License
974 stars 91 forks source link

Feat: add failed jobs as unused #283

Closed yonahd closed 4 months ago

yonahd commented 4 months ago

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

codecov-commenter commented 4 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

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

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

Additional details and impacted files ```diff @@ 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 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

doronkg commented 4 months ago

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?