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

Enable customization of org id and name when connecting to uaa-base endpoint #804

Merged
merged 1 commit into from
Sep 4, 2024

Conversation

vuil
Copy link
Contributor

@vuil vuil commented Sep 4, 2024

Also: update the ucp url to the correct one for uaa-based endpoints

What this PR does / why we need it

Which issue(s) this PR fixes

Fixes #

Describe testing done for PR

Ran unit tests.
Additional manually tested the following:

# verify env vars are picked up

> TANZU_CLI_SM_ORGANIZATION_NAME=testsm TANZU_CLI_SM_ORGANIZATION_ID=dcc5a0d5-92bd-4580-..... /bin/tanzu login --endpoint https://hubsm-host/ --insecure-skip-tls-verify

[i] Opening the browser window to complete the login
Log in by visiting this link:

    https://hubsm-host/oauth/authorize?client_id=tp_cli_app&code_challenge=wIM6VMLFW1EuJH6vow17fFgvYHdyn2jqIHBWK2UjBMw&code_challenge_method=S256&redirect_uri=http%3A%2F%2F127.0.0.1%3A51009%2Fcallback&response_type=code&state=bc39ff2c76ebd543474cfb83d7cb0870

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

[ok] Successfully logged in to 'https://hubsm-host/' and created a tanzu context

> tanzu context current
  Name:            tpsm-a436fc44
  Type:            tanzu
  Organization:    testsm (dcc5a0d5-92bd-4580-aa24-76f603e004b2)
  Project:         test (9fd5e29a-d556-459e-b1f8-137f605e8550)
  Kube Config:     /Users/johndoe/.config/tanzu/kube/config
  Kube Context:    tanzu-cli-tpsm-a436fc44:test

> grep -C2 testsm ~/.config/tanzu/config-ng.yaml
        tanzuMissionControlEndpoint: https://hubsm-host
        tanzuOrgID: dcc5a0d5-92bd-4580-aa24-76f603e004b2
        tanzuOrgName: testsm
currentContext:
    tanzu: tpsm-a436fc44

> grep -C2 dcc5a0d5-92bd-4580-aa24-76f603e004b2 ~/.config/tanzu/kube/config
- cluster:
    insecure-skip-tls-verify: true
    server: https://hubsm-host/dcc5a0d5-92bd-4580-aa24-76f603e004b2
  name: tanzu-cli-tpsm-a436fc44
contexts:

# verify that generated kube config is usable against UCP

> ./bin/tanzu project list
Listing projects from testsm org

  NAME  AGE  INTEGRATIONS
  abcd  26h  TANZU_APPLICATION_ENGINE
  test  26h  TANZU_APPLICATION_ENGINE

To set your active project use 'tanzu project use NAME'

> ./bin/tanzu project use test
Successfully set project to test
> ./bin/tanzu space list
No Spaces found.

> ./bin/tanzu avt list
No availability targets found.

Release note

Enable TANZU_CLI_SM_ORGANIZATION_NAME TANZU_CLI_SM_ORGANIZATION_ID to configure the Org name and id of a self-managed Tanzu Platform environment.

Additional information

Special notes for your reviewer

@vuil vuil requested a review from a team as a code owner September 4, 2024 20:38
…endpoint

Also: update the ucp url to the correct one for uaa-based endpoints

Signed-off-by: Vui Lam <[email protected]>
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.

@vuil vuil merged commit aa76610 into vmware-tanzu:main Sep 4, 2024
7 checks passed
@marckhouzam marckhouzam added this to the v1.5.0 milestone Sep 5, 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.

4 participants