Skip to content
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

Add support to update tanzu context with projectID along with projectName and fix for missing TMC endpoint details in tanzu context #708

Merged
merged 2 commits into from
Mar 19, 2024

Conversation

prkalle
Copy link
Contributor

@prkalle prkalle commented Mar 18, 2024

What this PR does / why we need it

This PR adds support to update the tanzu context with the project-id along with the project name. This PR also has fix to address the issue where TMC endpoint details are missing in the context when context is created with TANZU_API_TOKEN

Which issue(s) this PR fixes

Fixes #

Describe testing done for PR

Test updating the context with project id

Updated the context with project Id along with project name and validated the projectID in the context additionalMetadata is updated.

❯ ./bin/tanzu context update tanzu-active-resource prem-ucp-intg-lat-stg-test --project beta2-workflow-demo --project-id 8aeb4bd3-3e14-4763-a3d7-1c6eb1da2b8e --space kaaling



config file metadata content of the context `prem-ucp-intg-lat-stg-test`

      additionalMetadata:
        tanzuClusterGroupName: ""
        tanzuMissionControlEndpoint: https://tmc.tanzu-dev.cloud.vmware.com
        tanzuOrgID: 80e7606e-9d2d-45a9-9d2f-b172beceacaf
        tanzuProjectID: 8aeb4bd3-3e14-4763-a3d7-1c6eb1da2b8e
        tanzuProjectName: beta2-workflow-demo
        tanzuSpaceName: kaaling

Testing tanzu context additional metadata missing TMC endpoint details when the context was created with TANZU_API_TOKEN

Test with TANZU_API_TOKEN

❯ ./bin/tanzu context create prem-ucp-intg-lat-stg-test --type tanzu --endpoint https://api.tanzu-dev.cloud.vmware.com --staging
[i] API token env var is set

[ok] Successfully logged into 'One Tanzu Demo' organization and created a tanzu context
[i] Checking for required plugins for context 'prem-ucp-intg-lat-stg-test'...
[i] All required plugins are already installed and up-to-date

Config file updated:
      additionalMetadata:
        tanzuMissionControlEndpoint: https://tmc.tanzu-dev.cloud.vmware.com
        tanzuOrgID: 80e7606e-9d2d-45a9-9d2f-b172beceacaf

Test with interactive login

❯ unset TANZU_API_TOKEN
❯ ./bin/tanzu context create prem-ucp-intg-lat-stg-test2 --type tanzu --endpoint https://api.tanzu-dev.cloud.vmware.com --staging
[i] Opening the browser window to complete the login
Log in by visiting this link:

    https://console-stg.cloud.vmware.com/csp/gateway/discovery?client_id=tanzu-cli-client-id&code_challenge=lTYOzHDtsIu2SNcDlEuJDuA-oNxCha-L1G67dqfRPEY&code_challenge_method=S256&redirect_uri=http%3A%2F%2F127.0.0.1%3A62607%2Fcallback&response_type=code&state=ce1d77ac25d5b3ce6c44cca476b4eb67

    Optionally, paste your authorization code: [...]


[ok] Successfully logged into 'One Tanzu Demo' organization and created a tanzu context
[i] Checking for required plugins for context 'prem-ucp-intg-lat-stg-test2'...
[i] All required plugins are already installed and up-to-date

      additionalMetadata:
        tanzuMissionControlEndpoint: https://tmc.tanzu-dev.cloud.vmware.com
        tanzuOrgID: 80e7606e-9d2d-45a9-9d2f-b172beceacaf

Release note

Fixed the tanzu context missing TMC endpoint details in context additionalMetadata and also add support to update the context with projectID along with project name

Additional information

Special notes for your reviewer

…roject-id

Signed-off-by: Prem Kumar Kalle <pkalle@vmware.com>
…hen the context was created with TANZU_API_TOKEN

Signed-off-by: Prem Kumar Kalle <pkalle@vmware.com>
@prkalle prkalle requested a review from a team as a code owner March 18, 2024 18:47
@prkalle prkalle changed the title Add/ctx proj Add support to update tanzu context with projectID along with projectName and fix for missing TMC endpoint details in tanzu context Mar 18, 2024
Copy link
Contributor

@anujc25 anujc25 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@prkalle prkalle merged commit f8159a2 into vmware-tanzu:main Mar 19, 2024
8 checks passed
@marckhouzam marckhouzam added this to the v1.3.0 milestone Apr 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants