vmware-tanzu / tanzu-cli

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

Switch default discovery source registry to `projects.packages.broadcom.com` #755

Closed anujc25 closed 4 months ago

anujc25 commented 4 months ago

What this PR does / why we need it

Details:

Which issue(s) this PR fixes

Fixes #

Describe testing done for PR

$ tanzu plugin source list NAME IMAGE
default projects.registry.vmware.com/tanzu_cli/plugins/plugin-inventory:latest


* User installs the `v1.3.0` version of Tanzu CLI and runs any command for the first time, CLI will update the discovery source and prompt for EULA.

$ tz version version: v1.3.0-dev buildDate: 2024-04-29 sha: 82ca2e91-dirty arch: amd64

$ tz plugin list Some initialization of the CLI is required. Let's set things up for you. This will just take a few seconds.

Refreshing the 2 installed plugins... Updating default plugin discovery source to "projects.packages.broadcom.com/tanzu_cli/plugins/plugin-inventory:latest"...

Initialization done!

? You must agree to the VMware General Terms in order to download, install, or use software from this registry via Tanzu CLI. Acceptance of the VMware General Terms covers all software installed via the Tanzu CLI during any Session. “Session” means the period from acceptance until any of the following occurs: (1) a change to VMware General Terms, (2) a new major release of the Tanzu CLI is installed, (3) software is accessed in a separate software distribution registry, or (4) re-acceptance of the General Terms is prompted by VMware.

To view the VMware General Terms, please see https://www.vmware.com/vmware-general-terms.html.

If you agree, the essential plugins (required by the tanzu cli) will be automatically installed.

Note: this prompt can be avoided by running "tanzu config eula accept".

Do you agree to the VMware General Terms? Yes

== NAME DESCRIPTION TARGET INSTALLED STATUS
builder Build Tanzu components global v1.2.0 installed
telemetry configure cluster-wide settings for vmware tanzu telemetry global v1.1.0 installed

Verify that the plugin discovery source has been updated

$ tz plugin source list NAME IMAGE
default projects.packages.broadcom.com/tanzu_cli/plugins/plugin-inventory:latest


* If the user does not accept EULA, Tanzu CLI will throw an error like below

$ tz plugin list Some initialization of the CLI is required. Let's set things up for you. This will just take a few seconds.

Refreshing the 2 installed plugins... Updating default plugin discovery source to "projects.packages.broadcom.com/tanzu_cli/plugins/plugin-inventory:latest"...

Initialization done!

? You must agree to the VMware General Terms in order to download, install, or use software from this registry via Tanzu CLI. Acceptance of the VMware General Terms covers all software installed via the Tanzu CLI during any Session. “Session” means the period from acceptance until any of the following occurs: (1) a change to VMware General Terms, (2) a new major release of the Tanzu CLI is installed, (3) software is accessed in a separate software distribution registry, or (4) re-acceptance of the General Terms is prompted by VMware.

To view the VMware General Terms, please see https://www.vmware.com/vmware-general-terms.html.

If you agree, the essential plugins (required by the tanzu cli) will be automatically installed.

Note: this prompt can be avoided by running "tanzu config eula accept".

Do you agree to the VMware General Terms? No

== The Tanzu CLI is only usable with reduced functionality until the General Terms are agreed to. Please use tanzu config eula show to review the terms, or tanzu config eula accept to accept them directly [x] : terms not accepted


- If user has configured custom discovery source for internet restricted use-case it should not be updated on upgrade

$ tanzu version version: v1.2.0 buildDate: 2024-02-07 sha: f3abe62e arch: amd64

$ tanzu plugin source update default -u harbor-repo.vmware.com/tanzu_cli_stage/plugins/plugin-inventory:latest [i] Refreshing plugin inventory cache for "harbor-repo.vmware.com/tanzu_cli_stage/plugins/plugin-inventory:latest", this will take a few seconds. [i] Reading plugin inventory for "harbor-repo.vmware.com/tanzu_cli_stage/plugins/plugin-inventory:latest", this will take a few seconds. [ok] updated discovery source default


$ tz version version: v1.3.0-dev buildDate: 2024-04-29 sha: 82ca2e91-dirty arch: amd64

Note: The discovery source is not getting updated here because it was manually updated by the user to point to custom registry.

$ tz plugin list Some initialization of the CLI is required. Let's set things up for you. This will just take a few seconds.

Refreshing the 2 installed plugins...

Initialization done!

NAME DESCRIPTION TARGET INSTALLED STATUS
builder Build Tanzu components global v1.2.0 installed


$ tz plugin source list NAME IMAGE
default harbor-repo.vmware.com/tanzu_cli_stage/plugins/plugin-inventory:latest


<!-- Example: Created vSphere workload cluster to verify change. -->

### Release note
<!--
     Please add a short text (limit to 1 to 2 sentences if possible) in the release-note block below if
     there is anything in this PR that is worthy of mention in the next release.

     See https://github.com/vmware-tanzu/tanzu-cli/blob/main/docs/release/release-notes.md#does-my-pull-request-need-a-release-note
     for more details.
-->
```release-note
Switch the default discovery source registry to `projects.packages.broadcom.com`.

For any reason, if the user wants to switch back to the old registry `projects.registry.vmware.com`, run the following command to update discovery source `tanzu plugin source update default -u projects.registry.vmware.com/tanzu_cli/plugins/plugin-inventory:latest`. To switch back to the new default registry run the `tanzu plugin source init` command.

Additional information

Special notes for your reviewer

marckhouzam commented 4 months ago

Forgot these minor points:

Do we need to deal with users who are running v1.3.0-alpha.* or do we ask them to run tanzu plugin source init? Because the initializer will not trigger.

While at it, do you want to replace the followowign with something "broadcom"?

anujc25 commented 4 months ago

Do we need to deal with users who are running v1.3.0-alpha.* or do we ask them to run tanzu plugin source init? Because the initializer will not trigger.

I do not think we need to do anything to support v1.3.0-alpha.*. And as you mentioned if required we can ask users to run tanzu plugin source init in that specific case.

anujc25 commented 4 months ago

lgtm, I just have a question about the means to the eula retrigger. Also: Worth mentioning in some md how to revert back to projects.registry or you feel this is better done out-of-band?

I added that as part of the release note and might be better to keep it as part of the release note as most of the users should not need to switch back to the old registry.