Open evankanderson opened 2 years ago
The use of the "default" namespace when not specified has been coded here .
A possible approach here is to have the tanzu cli read the context from KUBECONFIG and set the namespace accordingly if it is not specified on the command line by "--namespace"
Continuing to investigate the proposed changed. The current behavior is documented as the expected behavior in several places in the documentation. For example here, where it shows that not specifying --namespace will install the package to the "default" namespace. If we go ahead and change the behavior we might need to scrub other parts of the docs and code to make sure the 'default" namespace is not assumed when --namespace is not provided.
The fixed proposed in https://github.com/vmware-tanzu/tanzu-framework/pull/1540 will continue to use "default" if no context is set. If the context is set the namespace define for that context will be used as default value. user can still set the namespace by using --namespace.
Thanks, the behavior in https://github.com/vmware-tanzu/tanzu-framework/issues/1351#issuecomment-1019918351 is exactly what I was hoping for.
Bug description
If you set your kubeconfig context like so:
Running commands like
tanzu package installed
without a--namespace
option will operate on thedefault
namespace, rather than thesomewhere
namespace. This means that for long sequences / scripts, you need to repeat the--namespace
argument every time.Affected product area (please put an X in all that apply)
Expected behavior
tanzu package
(and other plugins) respect the namespace in theKUBECONFIG
the same way that they respect the auth and cluster address there.Steps to reproduce the bug
Run the following on a TKG cluster:
Version (include the SHA if the version is not obvious)
0.10.0
Environment where the bug was observed (cloud, OS, etc)
TCE
Relevant Debug Output (Logs, manifests, etc)