Skip to content
This repository has been archived by the owner on Jun 26, 2023. It is now read-only.

HNC: cannot delete namespaces in 1.14 #889

Closed
adrianludwin opened this issue Jul 15, 2020 · 5 comments · Fixed by #890
Closed

HNC: cannot delete namespaces in 1.14 #889

adrianludwin opened this issue Jul 15, 2020 · 5 comments · Fixed by #890
Milestone

Comments

@adrianludwin
Copy link
Contributor

Repro at head:

$ k hns create sub -n default
$ k delete subns sub -n default

Log messages show that the webhook is failing because we can't decode the old object. We should be skipping this.

If it turns out that this is actually working in 0.5, then we can change the milestone back to 0.6.

@adrianludwin adrianludwin modified the milestones: hnc-v0.5.1, hnc-v0.6 Jul 15, 2020
@adrianludwin
Copy link
Contributor Author

adrianludwin commented Jul 15, 2020

This is due to the new object validator; the 0.5 validator didn't check deletions at all.

Why the object validator is being invoked on a namespace with no objects in it is somewhat of a mystery to me, but the logs certainly show this is happening (with an object name of ""!) in 1.14. Meanwhile, this works fine in 1.16. Perhaps it's some weird namespace-is-being-deleted code path.

Since the code is obviously wrong anyway, I'm going to go ahead and fix it. I'm not going to add any e2e tests though since 1.14 is very low priority.

adrianludwin added a commit to adrianludwin/multi-tenancy that referenced this issue Jul 15, 2020
See kubernetes-retired#688 and kubernetes-retired#889 - validators need to be able to handle that OldObject
might not be populated in K8s 1.14

Tested: can delete an empty (!) subnamespace in 1.14 with this change,
while it hangs forever and prints out error messages from the object
validators without this change. See kubernetes-retired#889 for more information.
@yiqigao217
Copy link
Contributor

Do you mean that the cannot decode is in the object validator but not namespace validator? We added 1.14 backward compatibility (allow deleting in 1.14) in namespace validator. To fix this issue, is it that we need to also add it to object validator?

@adrianludwin
Copy link
Contributor Author

Yeah. I don't understand it. Our namespace and anchor validators already handle a nil OldObject but the object validators didn't. This is a bug that needs to be fixed regardless, but I don't understand why the code was invoked when there were no objects at all.

@yiqigao217
Copy link
Contributor

Not sure if you've already noticed. Even deleting a full namespace (not subnamespace) doesn't work in 1.14 using the head before your fix #890 .

@adrianludwin
Copy link
Contributor Author

I hadn't. Wow. Makes sense though, I guess!

@adrianludwin adrianludwin changed the title HNC: cannot delete subns in 1.14 HNC: cannot delete namespaces in 1.14 Jul 15, 2020
adrianludwin added a commit to adrianludwin/multi-tenancy that referenced this issue Jul 22, 2020
See kubernetes-retired#688 and kubernetes-retired#889 - validators need to be able to handle that OldObject
might not be populated in K8s 1.14

Tested: can delete an empty (!) subnamespace in 1.14 with this change,
while it hangs forever and prints out error messages from the object
validators without this change. See kubernetes-retired#889 for more information.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants