Closed doronkg closed 3 weeks ago
:warning: Please install the to ensure uploads and comments are reliably processed by Codecov.
Attention: Patch coverage is 66.66667%
with 26 lines
in your changes missing coverage. Please review.
Project coverage is 43.38%. Comparing base (
673c21e
) to head (63f6aab
). Report is 2 commits behind head on main.
Files with missing lines | Patch % | Lines |
---|---|---|
pkg/kor/pdbs.go | 61.76% | 17 Missing and 9 partials :warning: |
:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
What this PR does / why we need it?
This PR changes the behavior of how
kor
maps unused PDBs. Currently, it validates the PDB label selector against Deployments/StatefulSets direct metadata labels, while it should validate the template labels, as PDBs select pods and through.metadata.ownerReferences
field finds the respective workload controllers and not the other way around.For example, the following Deployment is valid, but
kor
will map it as unused, as.metadata.labels
field is not matched, even if the template labels match:In addition, added support for empty selectors & arbitrary pods.
PR Checklist
GitHub Issue
Closes #364
Notes for your reviewers
Based the feature on the official PDB docs.