-
Notifications
You must be signed in to change notification settings - Fork 20
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
[Story] Operator should handle target namespace deletion #941
Comments
@andrewazores I suppose with the above implementation, that CR would fail to reconcile until the namespace is recreated. The operator would keep trying to create the objects in a non-existent namespace. Perhaps that's okay, the CR does specify an invalid spec if the target namespace doesn't exist (currently). |
I think that makes enough sense - we just have to make sure we document this. But I agree that listing target namespaces that don't exist should be considered an invalid spec, and it's probably best that this results in some kind of a failure rather than a silent acceptance. In particular, if we are doing things like copying secrets into the target namespaces, then silently failing if the namespace doesn't exist, only to then perform the copy at a later date if it does get created, seems like it might be surprising behaviour and potentially a security issue - the user might have typo'd a namespace name by accident, not noticed because the deployment succeeded, and then their secret gets inadvertently created and shared into a different namespace later on which they did not intend. We have talked about this kind of problem before, where the Operator should be proactive about checking RBAC for each of the target namespaces - is there a particular Issue we can link this to? |
Do you mean this sort of multi-tenancy issue: #579? |
Yes that looks like it's probably what I'm thinking of. |
I suppose other objects that are placed in target namespaces would suffer from the same issue (e.g. role bindings, CA secrets). This might be a bit tricky to handle. Since we can't have cross-namespace owner references, maybe we could do something like this:
As for deleting the certificate object from the install namespace for deleted namespaces, we could issue a get request for the namespace and, if it doesn't exist, delete the certificate and secret. I think the namespace deletion event should be captured with the above custom controller watch.
Originally posted by @ebaron in #938 (comment)
The text was updated successfully, but these errors were encountered: