-
Notifications
You must be signed in to change notification settings - Fork 40k
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
Namespace deletion uses discovery + dynamic client #21400
Namespace deletion uses discovery + dynamic client #21400
Conversation
see: #20351 (comment) |
92c57fd
to
c41330b
Compare
3e40b48
to
5ba3797
Compare
@lavalamp @thockin @bgrant0607 - this PR updates the namespace controller to use the discovery client to find the list of supported resources, and the dynamic client to then delete those resources. this should eliminate developer errors where developers had forgot to do this manually. assuming this is stable, it may be worth our while to have it in 1.2. /cc @smarterclayton @kubernetes/rh-cluster-infra |
ed20247
to
f3b8b73
Compare
@liggitt - can you take a look as well? |
GCE e2e test build/test passed for commit f3b8b739d0ef19fe6c0fce50128077eb4b85bfea. |
@krousey Can you take a look? |
@lavalamp sure. Is this 1.2 critical? |
It's 1.2 nice-to-have. |
05556c6
to
788e65c
Compare
Recording here so I do not forget: To support re-using the same controller to delete downstream OpenShift specific resources or in federated API server use cases, I will need to let a namespace controller have a finalizer token that it is associated with passed in during creation. |
GCE e2e test build/test passed for commit 05556c62977dc0c5d867d64c96040c2cebf0b390. |
GCE e2e test build/test passed for commit 788e65c7fda85d321ee96f667168487d16a7f1bb. |
if len(groupVersion.Group) == 0 { | ||
return "/api" | ||
} | ||
return "/apis" |
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 know it's not, but shouldn't this be in the discovery into?
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.
opened issue: #21916
I finally got a chance to go through this. @derekwaynecarr sorry it took me so long. |
PR needs rebase |
41c4797
to
601096f
Compare
@lavalamp - rebased, and updated per code review requests. PTAL |
601096f
to
773cf73
Compare
GCE e2e build/test passed for commit 773cf73. |
GCE e2e build/test passed for commit beace2d. |
// this is strange, but we need to special case for both MethodNotSupported and NotFound errors | ||
// TODO: https://github.com/kubernetes/kubernetes/issues/22413 | ||
// we have a resource returned in the discovery API that supports no top-level verbs: | ||
// /apis/extensions/v1beta1/namespaces/default/replicationcontrollers |
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.
So, rather than this special case here, you may want to special case just this and keep it out of the resource list entirely. That path only exists to mount a subresource. We won't ever make anything like it again.
So I have a bunch of nitpicky things that I said and some I didn't say. But if you're confident that this works, I'm willing to hold my nose and LGTM. |
LGTM thanks! |
@k8s-bot test this [submit-queue is verifying that this PR is safe to merge] |
GCE e2e build/test passed for commit beace2d. |
Automatic merge from submit-queue |
…overy Auto commit by PR queue bot
Fixes: #14765
Fixes: #21701
The namespace controller:
This means developers no longer need to remember to clean-up their resource as part of namespace lifecycle.