yonahd / kor

A Golang Tool to discover unused Kubernetes Resources
MIT License
1.04k stars 96 forks source link

feat: unused StorageClasses #216

Closed doronkg closed 8 months ago

doronkg commented 8 months ago

This PR adds a new functionality to kor by finding unused StorageClasses. I've considered StorageClasses to be unused, if they aren't used by any PVs/PVCs.

$ kor storageclass
kor version: vdev

  _  _____  ____
 | |/ / _ \|  _ \
 | ' / | | | |_) |
 | . \ |_| |  _ <
 |_|\_\___/|_| \_\

Unused StorageClasses in Namespace:
+---+---------------------+
| # |    RESOURCE NAME    |
+---+---------------------+
| 1 | example-vol-default |
+---+---------------------+
codecov-commenter commented 8 months ago

Codecov Report

Attention: Patch coverage is 43.15068% with 83 lines in your changes are missing coverage. Please review.

Project coverage is 47.48%. Comparing base (379f27a) to head (f070788). Report is 2 commits behind head on main.

Files Patch % Lines
pkg/kor/all.go 0.00% 40 Missing :warning:
pkg/kor/storageclasses.go 60.00% 22 Missing and 10 partials :warning:
pkg/kor/delete.go 0.00% 7 Missing :warning:
pkg/kor/multi.go 0.00% 4 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 #216 +/- ## ========================================== - Coverage 47.71% 47.48% -0.24% ========================================== Files 31 32 +1 Lines 2741 2883 +142 ========================================== + Hits 1308 1369 +61 - Misses 1274 1345 +71 - Partials 159 169 +10 ```

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