-
Notifications
You must be signed in to change notification settings - Fork 7k
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: uninstall action resource namespace #12783
Fix: uninstall action resource namespace #12783
Conversation
Signed-off-by: Paul Barrié <paul.barrie.calmels@gmail.com>
518f11b
to
e8c46f0
Compare
I've run the provided fix and confirmed:
Effectively 2 namespace values are passed into the cfg.init:
The namespace parameter is used by the driver, while the KubeClient gets its namespace from the ClientGetter - so this change, to align the values seems reasonable. All commands (bar "List") force the namespace parameter to be the same as the context/environment provided value - so generally these two values are the same. There is some code in the Client which manages "use override namespace or value from environment", which maybe able to be removed if an "merged" config was created upfront (rather than managing 2 namespace variables through the codebase). |
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.
LGTM
This is done else where in the code this should be rejected. |
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.
This is a common ask but it's not so simple to set it here. The Initialized configuration can be used in multiple actions in a log running process. Such as a daemon that uses this as an SDK.
This initialization is for where the record of the release is stored instead of the manifests that are generated and uploaded. They can technically be in different places and the SDK allows for that.
You can see an example of how the actions put the namespace in over at
Line 334 in d1595e7
err = resources.Visit(setMetadataVisitor(rel.Name, rel.Namespace, true)) |
I don't think this setup is ideal but we can't break the intent until Helm v4 where we can make some broader changes.
closes#12766
At init configuration the kubeclient namespace is not set. When the uninstall action is triggered, if the release has been installed in a non-default namespace, the resource without any namespace provided (which are installed in the release's namespace) are not deleted since it tries to delete resources in the namespace "".