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

Update the UX for "context use" and "context list" commands to show ProjectID details #721

Merged
merged 1 commit into from
Apr 4, 2024

Conversation

prkalle
Copy link
Contributor

@prkalle prkalle commented Apr 2, 2024

What this PR does / why we need it

This PR updates the UX for "context use" and "context list" commands to show ProjectID details

Which issue(s) this PR fixes

Fixes #

Describe testing done for PR

Context list with --wide option shows Project ID

❯ ./bin/tanzu context list --wide
  NAME                                ISACTIVE  TYPE             PROJECT           PROJECTID                             SPACE  CLUSTERGROUP  ENDPOINT                                                                                                      KUBECONFIGPATH                           KUBECONTEXT
  TestProjectSyncer-staging-3d4f75b3  true      tanzu            kshaheer-project  2d59a92e-1694-4123-b89a-809e241e53f6                       https://test-project-syncer.stacks.bluesky.tmc-dev.cloud.vmware.com/org/dcd7e146-57e6-4a1b-905c-0d4079dc9f38  /Users/pkalle/.kube/config               tanzu-cli-TestProjectSyncer-staging-3d4f75b3
  mytmc-ctx                           true      mission-control  n/a               n/a                                   n/a    n/a           unstable.tmc-dev.cloud.vmware.com:443                                                                         n/a                                      n/a
  prem-ucp-prod-test                  false     tanzu            sre-project                                             test                 https://api.tanzu.cloud.vmware.com/org/bc6f01a5-8618-4fed-a457-161d3a138052                                   /Users/pkalle/.kube/config               tanzu-cli-prem-ucp-prod-test
  tkg-mgmt-vc                         false     kubernetes       n/a               n/a                                   n/a    n/a                                                                                                                         /Users/pkalle/temp/tkgCluster_admin.kfg  tkg-mgmt-vc-admin@tkg-mgmt-vc
  tt-test-selfmg                      false     mission-control  n/a               n/a                                   n/a    n/a           tmc-sm-main.local-dev.7infra.com:443                                                                          n/a                                      n/a



❯ ./bin/tanzu context list
  NAME                                ISACTIVE  TYPE             PROJECT           SPACE
  TestProjectSyncer-staging-3d4f75b3  true      tanzu            kshaheer-project
  mytmc-ctx                           true      mission-control  n/a               n/a
  prem-ucp-prod-test                  false     tanzu            sre-project       test
  tkg-mgmt-vc                         false     kubernetes       n/a               n/a
  tt-test-selfmg                      false     mission-control  n/a               n/a

[i] Use '--wide' flag to view additional columns.
  • tanzu context use command shows the project ID along with project name and space details(if available)
# for tanzu context with project as active resource
❯ ./bin/tanzu context use testprojectsyncer
[i] Activated context 'testprojectsyncer' (Type: tanzu, Project: kshaheer-project (2d59a92e-1694-4123-b89a-809e241e53f6))
[i] Checking for required plugins for context 'testprojectsyncer'...
[i] All required plugins are already installed and up-to-date


# for tanzu context with space as active resource
❯ ./bin/tanzu context update tanzu-active-resource testprojectsyncer --project kshaheer-project --project-id 2d59a92e-1694-4123-b89a-809e241e53f6  --space test
❯ ./bin/tanzu context use testprojectsyncer
[i] Activated context 'testprojectsyncer' (Type: tanzu, Project: kshaheer-project (2d59a92e-1694-4123-b89a-809e241e53f6), Space: test)
[i] Checking for required plugins for context 'testprojectsyncer'...
[i] All required plugins are already installed and up-to-date

# for mission-control context it would only show the context Type
❯ ./bin/tanzu context use mytmc-ctx
[i] Activated context 'mytmc-ctx' (Type: mission-control) successfully
[i] Checking for required plugins for context 'mytmc-ctx'...
[i] All required plugins are already installed and up-to-date

Release note

Update the UX for "context use" and "context list" commands to show ProjectID details

Additional information

Special notes for your reviewer

@prkalle prkalle requested a review from a team as a code owner April 2, 2024 16:52
@marckhouzam marckhouzam added this to the v1.3.0 milestone Apr 3, 2024
pkg/command/context.go Outdated Show resolved Hide resolved
pkg/command/context.go Outdated Show resolved Hide resolved
…rojectID details

Signed-off-by: Prem Kumar Kalle <prem.kalle@broadcom.com>
Copy link
Contributor

@marckhouzam marckhouzam left a comment

Choose a reason for hiding this comment

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

LGTM
Thanks @prkalle !

@prkalle prkalle merged commit a7f2678 into vmware-tanzu:main Apr 4, 2024
7 checks passed
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.

3 participants