chore: remove the unused allow package - #3081
Conversation
pkg/allow has no references anywhere in the repository: no callers, no tests, no documentation. Label allowlisting is implemented entirely in internal/store, through createPrometheusLabelKeysValues and the allowLabelsList threaded down from the builder. It had also drifted out of correctness while nothing exercised it. Allowed indexes values[i] while ranging over labels, so a shorter values panics; and its nested loop appends a pair per match, so a duplicate entry in labels yields the same label name twice -- which Prometheus rejects, taking the whole scrape with it. This removes an exported package, so it is a breaking change for anyone importing k8s.io/kube-state-metrics/v2/pkg/allow directly.
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: mrueg The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
This issue is currently awaiting triage. If kube-state-metrics contributors determine this is a relevant issue, they will accept it by applying the The DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
💤 Files with no reviewable changes (1)
📝 WalkthroughWalkthroughThe pull request deletes Changes
Estimated code review effort: 1 (Trivial) | ~2 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
What this PR does / why we need it:
pkg/allowhas no references anywhere in the repository — no callers, no tests, no documentation:Label allowlisting is implemented entirely in
internal/store, viacreatePrometheusLabelKeysValuesand theallowLabelsListthreaded down from the builder.pkg/allowis a parallel implementation that nothing has called.It has also drifted out of correctness while nothing exercised it.
Allowedindexesvalues[i]while ranging overlabels, so avaluesshorter thanlabelspanics. And its nested loop appends a pair per match, so a duplicate entry inlabelsproduces the same label name twice — which Prometheus rejects, discarding the entire scrape rather than the offending series (the same failure mode as #3064). Neither is reachable today precisely because the package is dead, but they are what carrying it forward would eventually cost.go build ./...,go vet ./..., the full unit suite andgolangci-lint runare all clean with it removed.k8s.io/kube-state-metrics/v2/pkg/allowdirectly. Nothing in tree does, and the package is unusable as a drop-in replacement for the internal implementation anyway, but the module is published — so this is a maintainer call rather than a mechanical cleanup.How does this change affect the cardinality of KSM: does not change cardinality
Which issue(s) this PR fixes: N/A
Summary by CodeRabbit