The Tanzu Core CLI project provides the core functionality of the Tanzu CLI. The CLI is based on a plugin architecture where CLI command functionality can be delivered through independently developed plugin binaries
Apache License 2.0
33
stars
21
forks
source link
Allow customizing the Tanzu Hub endpoint when creating tanzu context #782
Allow customizing the Tanzu Hub endpoint when creating a tanzu context.
Implements a hidden flag tanzu-hub-endpoint with tanzu login and tanzu context create commands.
If configured, the tanzu context will be created with the specified value in the tanzuHubEndpoint field under additionalMetadata.
An additional log line This tanzu context is being created with the custom Tanzu Hub endpoint: "<specified-endpoint>" will be printed when this flag is specified while creating the context.
Which issue(s) this PR fixes
Fixes #
Describe testing done for PR
Verify with tanzu login
$ tz login --tanzu-hub-endpoint https://api.be-tis.symphony-dev.com/hub
[i] Opening the browser window to complete the login
Log in by visiting this link:
https://console.cloud.vmware.com/csp/gateway/discovery?client_id=tanzu-cli-client-id&code_challenge=pVnmvp7umB7r0cGI-cvnU6yT8GVwj8vINhw_ASevFtM&code_challenge_method=S256&redirect_uri=http%3A%2F%2F127.0.0.1%3A52346%2Fcallback&response_type=code&state=ff12de5be3480b15c797115d05380dd1
Optionally, paste your authorization code: [...]
[!] This tanzu context is being created with the custom Tanzu Hub endpoint: "https://api.be-tis.symphony-dev.com/hub"
[ok] Successfully logged into 'Tanzu Platform for K8s SaaS - Internal 1' organization and created a tanzu context
----
$ tz context get Tanzu_Platform_for_K8s_SaaS_-_Internal_1
name: Tanzu_Platform_for_K8s_SaaS_-_Internal_1
target: tanzu
contextType: tanzu
...
additionalMetadata:
tanzuClusterGroupName: ""
tanzuHubEndpoint: https://api.be-tis.symphony-dev.com/hub
tanzuMissionControlEndpoint: https://tmc.tanzu.cloud.vmware.com
tanzuOrgID: 8406e52e-6e36-445a-be7b-9dab6903341e
tanzuOrgName: Tanzu Platform for K8s SaaS - Internal 1
tanzuProjectID: 0f49c031-6294-4bdf-b363-55ae96788402
tanzuProjectName: longevity-project
tanzuSpaceName: tshaine
Verify with tanzu context create:
$ tz context create TP-context-with-custom-hub-endpoint --type tanzu --tanzu-hub-endpoint https://api.be-tis.symphony-dev.com/hub
? Enter control plane endpoint https://api.tanzu.cloud.vmware.com
[i] Opening the browser window to complete the login
Log in by visiting this link:
https://console.cloud.vmware.com/csp/gateway/discovery?client_id=tanzu-cli-client-id&code_challenge=YDlk-X3c7vgZc98K_VdSb9-OxS_os2bNZA4ADc1GEKo&code_challenge_method=S256&redirect_uri=http%3A%2F%2F127.0.0.1%3A52981%2Fcallback&response_type=code&state=e0d2bf13bc93e612d2b5b77d6ac4dd7e
Optionally, paste your authorization code: [...]
[!] This tanzu context is being created with the custom Tanzu Hub endpoint: "https://api.be-tis.symphony-dev.com/hub"
[ok] Successfully logged into 'Tanzu Platform for K8s SaaS - Internal 1' organization and created a tanzu context
---
$ tz context get TP-context-with-custom-hub-endpoint
name: TP-context-with-custom-hub-endpoint
target: tanzu
contextType: tanzu
...
additionalMetadata:
tanzuHubEndpoint: https://api.be-tis.symphony-dev.com/hub
tanzuMissionControlEndpoint: https://tmc.tanzu.cloud.vmware.com
tanzuOrgID: 8406e52e-6e36-445a-be7b-9dab6903341e
tanzuOrgName: Tanzu Platform for K8s SaaS - Internal 1
What this PR does / why we need it
tanzu-hub-endpoint
withtanzu login
andtanzu context create
commands.tanzu
context will be created with the specified value in thetanzuHubEndpoint
field underadditionalMetadata
.This tanzu context is being created with the custom Tanzu Hub endpoint: "<specified-endpoint>"
will be printed when this flag is specified while creating the context.Which issue(s) this PR fixes
Fixes #
Describe testing done for PR
Verify with
tanzu login
Verify with
tanzu context create
:Release note
Additional information
Special notes for your reviewer