Closed prkalle closed 4 months ago
still looking at the change, but highlevel comment is that the context name feels really long what do you think of doing away with project: and space:. I to recognize in some situation the third part could be clustergroup: but even so I don't feel too bad about not having the resource type in the context name. cc @anujc25 @prkalle
lgtm. A nit on the documentation, but my main question is able whether we should go for a more compact kube context name format.
still looking at the change, but highlevel comment is that the context name feels really long what do you think of doing away with project: and space:. I to recognize in some situation the third part could be clustergroup: but even so I don't feel too bad about not having the resource type in the context name. cc @anujc25 @prkalle
I like this as well. I would prefer the compact format if there are no other issues.
still looking at the change, but highlevel comment is that the context name feels really long what do you think of doing away with project: and space:. I to recognize in some situation the third part could be clustergroup: but even so I don't feel too bad about not having the resource type in the context name. cc @anujc25 @prkalle
Sounds good to me.
What this PR does / why we need it
This PR has changes to update kubecontext name associated with
tanzu
CLI context when active resource is updated.Summary of changes:
tanzu
CLI context when active resource is updated.The naming of the context would betanzu-cli-<CLI-ContextName>[:<projectName>[[:<spaceName> | <clustergroupName>]]
(example:tanzu-cli-testCtx-d03c5c97:project-beta3-validation:space-demo3
)TANZU_CLI_USE_STABLE_KUBE_CONTEXT_NAME
totrue
Which issue(s) this PR fixes
Fixes #
Describe testing done for PR
Used tanzu login command to login to create a tanzu context and updated the context to point to project and later to space and verified the kubecontext name is updated to reflect the current active resource. Also the kubecontext name is updated in the CLI context too.
Verified that kubecontext name would not change once we export the environment variable
TANZU_CLI_USE_STABLE_KUBE_CONTEXT_NAME
to trueRelease note
Additional information
Note: If user sets the environment variable
TANZU_CLI_USE_STABLE_KUBE_CONTEXT_NAME
to "true" while being currently at the project/space, there won't be any kubecotnext name changes thereof. Lets say if the user is at space and the current kubecontext name istanzu-cli-TAP_pre-integration-staging-d03c5c97:project:helm-repo:space:wfd-official
, and then if user sets theTANZU_CLI_USE_STABLE_KUBE_CONTEXT_NAME
totrue
, then the same existing name would previal even if the user updates the CLI context to point to different active resource.Special notes for your reviewer