-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Remove FieldSelector from non-namespaced resources #2190
Conversation
This should resolve the issue with namespace-denylist as discovered in kubernetes#2187 Regression introduced in kubernetes@c3c5528 Signed-off-by: Manuel Rüger <[email protected]>
Signed-off-by: Damien Grisonnet <[email protected]>
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 Instructions 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/test-infra repository. |
For reference, the list of cluster-scoped resources in a cluster can be gathered by running: { for api in $(k get --raw /apis | jq -r '.groups[].preferredVersion.groupVersion') ; do k get --raw /apis/$api | jq '.resources[] | select(.namespaced == false) | select(.name | test("^\\w+$")) | .kind' ; done & k get --raw /api/v1 | jq '.resources[] | select(.namespaced == false) | select(.name | test("^\\w+$")) | .kind' } | sort | uniq which in a simple kind cluster yields:
|
Thanks for taking over! /lgtm /hold |
(owing to @dgrisonnet's neat one-liner above) I can see that all /lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: dgrisonnet, mrueg, rexagod The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/hold cancel |
Any ideas as to a timeframe when this will be included in a release? This issue would manifest as an unpleasant surprise to those that are blindly upgrading their clusters as 'watch' and 'get' actions for any non-namespaced resources will fail due to API validation. The issue manifests itself as a fairly innocent log entry:
But in this case we would receive no related node metrics at all. PersistentVolumes are also cluster scoped resources and KSM produces metrics from those resources that are useful to all so I might be tempted to get this fix out sooner rather than later. |
This PR takes over the initial work started by @mrueg in #2189 and fix the additional cluster-scoped resources that were missing.
What this PR does / why we need it:
This should resolve the issue with namespace-denylist as discovered in #2187
Regression introduced in c3c5528
I'm not sure if the fix is complete or other resources are affected. I'm also not sure if this is the right fix or we should simply keep the field selector but fail if the field doesn't exist.
Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Fixes #2187