yonahd / kor

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

Feat: added support for unused DaemonSets #199

Closed doronkg closed 7 months ago

doronkg commented 8 months ago

This PR adds a new functionality to kor by finding unused DaemonSets. I've considered DaemonSets to be unused, if the following condition is met:

status:
  currentNumberScheduled: 0

Meaning the number of nodes that should be running at least 1 daemon pod and are supposed to run the daemon pod, is equal to zero. More information about DaemonSets' status fields could be found in these docs.

codecov-commenter commented 8 months ago

Codecov Report

Attention: 36 lines in your changes are missing coverage. Please review.

Comparison is base (d63de17) 44.43% compared to head (32653f8) 44.61%.

Files Patch % Lines
pkg/kor/daemonsets.go 60.86% 12 Missing and 6 partials :warning:
pkg/kor/all.go 0.00% 9 Missing :warning:
pkg/kor/delete.go 0.00% 7 Missing :warning:
pkg/kor/multi.go 0.00% 2 Missing :warning:

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

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #199 +/- ## ========================================== + Coverage 44.43% 44.61% +0.18% ========================================== Files 29 30 +1 Lines 2444 2517 +73 ========================================== + Hits 1086 1123 +37 - Misses 1205 1235 +30 - Partials 153 159 +6 ```

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

doronkg commented 8 months ago

Conflicts might raise in files pkg/kor/delete.go (#201) & charts/kor/templates/role.yaml (#202). Should be taken into account when merging.