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

Show scope path of the tanzu resource for context type tanzu #852

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

prkalle
Copy link
Contributor

@prkalle prkalle commented Feb 3, 2025

What this PR does / why we need it

Show scope path of the tanzu resource for context type tanzu

Which issue(s) this PR fixes

Fixes #

Describe testing done for PR

Verified with context pointing to org/project/space/clustergroup

❯ ./bin/tanzu context current
  Name:            tpsm-412d4f42
  Type:            tanzu
  Organization:    TPE PV Main (eac7cec7-8568-4683-a4a4-1a6e8a009fb7)
  Project:         none set
  Scope Path:      /
  Kube Config:     /Users/pkalle/.config/tanzu/kube/config
  Kube Context:    tanzu-cli-tpsm-412d4f42

❯ ./bin/tanzu project use  tpe_test
✓ Successfully set project to tpe_test
❯ ./bin/tanzu context current
  Name:            tpsm-412d4f42
  Type:            tanzu
  Organization:    TPE PV Main (eac7cec7-8568-4683-a4a4-1a6e8a009fb7)
  Project:         tpe_test (6b52eea7-2d4e-434c-9c87-14e42bda67a5)
  Scope Path:      /projects/tpe_test
  Kube Config:     /Users/pkalle/.config/tanzu/kube/config
  Kube Context:    tanzu-cli-tpsm-412d4f42:tpe_test

❯ ./bin/tanzu space use test-101
✓ Successfully set space to test-101
❯ ./bin/tanzu context current
  Name:            tpsm-412d4f42
  Type:            tanzu
  Organization:    TPE PV Main (eac7cec7-8568-4683-a4a4-1a6e8a009fb7)
  Project:         tpe_test (6b52eea7-2d4e-434c-9c87-14e42bda67a5)
  Space:           test-101
  Scope Path:      /projects/tpe_test/spaces/test-101
  Kube Config:     /Users/pkalle/.config/tanzu/kube/config
  Kube Context:    tanzu-cli-tpsm-412d4f42:tpe_test:test-101
❯ ./bin/tanzu operations clustergroup use build-cluster-group
ℹ  project has been set to tpe_test
ℹ  successfully set clustergroup to build-cluster-group
❯  ./bin/tanzu context current
  Name:             tpsm-412d4f42
  Type:             tanzu
  Organization:     TPE PV Main (eac7cec7-8568-4683-a4a4-1a6e8a009fb7)
  Project:          tpe_test (6b52eea7-2d4e-434c-9c87-14e42bda67a5)
  Cluster Group:    build-cluster-group
  Scope Path:       /projects/tpe_test/clustergroups/build-cluster-group
  Kube Config:      /Users/pkalle/.config/tanzu/kube/config
  Kube Context:     tanzu-cli-tpsm-412d4f42:tpe_test:build-cluster-group

Verified that scope path is not shown for TMC context type

❯ tanzu context create --name tmc --endpoint unstable.tmc-dev.cloud.vmware.com --staging
Flag --name has been deprecated, it has been replaced by using an argument to the command
[i] API token env var is set

[ok] successfully created a TMC context
[...]

❯ ./bin/tanzu context current
  Name:        tmc
  Type:        mission-control

Release note

Show scope path of the tanzu resource for context type tanzu

Additional information

Special notes for your reviewer

@prkalle prkalle requested a review from a team as a code owner February 3, 2025 23:33
@prkalle prkalle force-pushed the update/showScopePath branch from 8bee557 to 6dd11e8 Compare February 4, 2025 17:39
Copy link
Contributor

@vuil vuil left a comment

Choose a reason for hiding this comment

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

LGTM. Part of me wishes getTanzuResourceScopePath can be done is a more data driven fashion, but okay that we have a TODO to explain the implications of not doing so.

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 force-pushed the update/showScopePath branch from 6dd11e8 to 74446e6 Compare February 4, 2025 19:09
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.

Even better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants