-
Notifications
You must be signed in to change notification settings - Fork 39.3k
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
Add validation when removing cluster-scope resources and providing namespace #62167
Conversation
this is a breaking change, correct? |
Yes, I'm still struggling whether this is a good approach but I couldn't come up with a better one. I want to provide some sort of diligence when removing cluster-scoped resources here. |
/test pull-kubernetes-integration |
Test ok in my environment. |
Looks like this change breaks: kubernetes/hack/make-rules/test-cmd-util.sh Line 5198 in 5898d59
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: soltysh 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 |
Updated. |
@@ -5195,7 +5195,8 @@ runTests() { | |||
kube::test::get_object_assert 'clusterrolebindings -l test-cmd=auth' "{{range.items}}{{$id_field}}:{{end}}" 'testing-CRB:' | |||
kube::test::get_object_assert 'clusterroles -l test-cmd=auth' "{{range.items}}{{$id_field}}:{{end}}" 'testing-CR:' | |||
|
|||
kubectl delete "${kube_flags[@]}" rolebindings,role,clusterroles,clusterrolebindings -n some-other-random -l test-cmd=auth |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I actually think uses like this are exactly the reason we shouldn't make this breaking change
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't feel too strong in any direction, to be honest.
@soltysh: The following tests failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. 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. I understand the commands that are listed here. |
Based on the feedback I think we'll want to provide something like #17740, instead. |
What this PR does / why we need it:
This pr prevents use-cases such as
kubectl delete ns --all -n xyz
by verifying if a cluster-scope resource is provided with a namespace parameter.@kubernetes/sig-cli-pr-reviews wdyt about this approach?
Release note: