-
Notifications
You must be signed in to change notification settings - Fork 169
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(kubernetes): let kubectl handle namespaces #208
Conversation
Instead of naively setting the default namespaces on objects that don't have one, we now overlay `$KUBECONFIG` with a patch to set the default namespace on the context, so that `kubectl` will do the job for us. `kubectl` does this far more intelligent than we did, especially it does not inject the namespace on objects that don't take one anymore.
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.
Nice, this is a good approach. Just one comment about handling the lack of $KUBECONFIG
now rather than having to do it later.
Properly handles the implicit default namespace (`""`, missing field) in `client.DiffServerSide`. Before, these objects were flagged as non-existent and always displayed a diff, which was incorrect. Adds a test to ensure this for the future
Fixed an issue with Added tests:
PTAL @rfratto |
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!
Instead of naively setting the default namespaces on objects that don't
have one, we now overlay
$KUBECONFIG
with a patch to set the defaultnamespace on the context, so that
kubectl
will do the job for us.kubectl
does this far more intelligent than we did, especially it doesnot inject the namespace on objects that don't take one.
Fixes #190
There is one
TODO
left in injecting the patch into$KUBECONFIG
:tanka/pkg/kubernetes/client/kubectl.go
Lines 68 to 72 in 0257f10