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

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

Merged
merged 2 commits into from
May 1, 2024

Conversation

anujc25
Copy link
Contributor

@anujc25 anujc25 commented Apr 29, 2024

What this PR does / why we need it

  • Switch the default discovery source registry to projects.packages.broadcom.com.
  • All the plugins have been migrated to the new registry at projects.packages.broadcom.com/tanzu_cli
  • Previous registry project.registry.vmware.com/tanzu_cli will be kept for some time for users consuming older versions of Tanzu CLI and both projects.packages.broadcom.com/tanzu_cli and project.registry.vmware.com/tanzu_cli.
  • The expectation is that all Tanzu CLI will gradually move to Tanzu CLI v1.3.0 or greater.

Details:

  • When the user switches from pre-v1.3.0 Tanzu CLI to v1.3.0 or newer version, Tanzu CLI will automatically update the discovery source to use the new location projects.packages.broadcom.com/tanzu_cli/plugins/plugin-inventory:latest
  • Considering the registry from where the plugins will get installed going forward has been updated, users will see the EULA acceptance prompt again and users must accept terms before continuing to use Tanzu CLI.
  • If the user is in the internet-restricted environment and has already updated the discovery source to point to a different registry, no changes will be made in that case.

Which issue(s) this PR fixes

Fixes #

Describe testing done for PR

  • User is using the pre-v1.3.0 (v1.2.0) version of Tanzu CLI.
$ tanzu version
version: v1.2.0
buildDate: 2024-02-07
sha: f3abe62e
arch: amd64

$ 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

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

@anujc25 anujc25 force-pushed the switch-registry branch 2 times, most recently from 777002f to 7d2c0ca Compare April 30, 2024 18:10
@anujc25 anujc25 marked this pull request as ready for review April 30, 2024 18:21
@anujc25 anujc25 requested a review from a team as a code owner April 30, 2024 18:21
@anujc25 anujc25 force-pushed the switch-registry branch 2 times, most recently from 956fbcc to be9b8f9 Compare April 30, 2024 19:30
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.

Nicely done. I was worried this would be difficult, but you found a very elegant way to handle this! Nice.

Minor nits but LGTM

pkg/globalinit/plugin_discovery_source_update.go Outdated Show resolved Hide resolved
pkg/globalinit/plugin_discovery_source_update.go Outdated Show resolved Hide resolved
@marckhouzam marckhouzam added this to the v1.3.0 milestone Apr 30, 2024
@marckhouzam
Copy link
Contributor

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"?

  • "project-stg.registry.vmware.com" in cmd/plugin/builder/README.md
  • "test-registry1.harbor.vmware.com" and "test-registry2.harbor.vmware.com" in docs/full/README.md
  • "custom.registry.vmware.com" in pkg/command/plugin_bundle.go

@anujc25
Copy link
Contributor Author

anujc25 commented Apr 30, 2024

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.

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!


// Considering we are updating the discovery source to point to new registry,
// User must be prompted to access the EULA again. So, let's first unset EULA status
err = config.SetEULAStatus(config.EULAStatusUnset)
Copy link
Contributor

@vuil vuil Apr 30, 2024

Choose a reason for hiding this comment

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

I have always expected when we need to reprompt EULA it will involve (1) setting a new major.minor
in CurrentEULAVersion, and (2) updating the eulaPromptMsg,
instead of explicitly unsetting the status.

Can we consider this a special situation that doesn't follow this pattern?
Could we have just done (1) instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point. I didn't think about (1) at all before you mentioned it. We can go with approach (1) as well.

The minor difference will be that with the current approach, we do not prompt EULA for the users using the custom registry. But with the approach (1) you mentioned, it will always be prompted for the users. I think it makes sense to prompt the EULA again for all the users as users can use the tanzu plugin download-bundle which will download images from a new location by default.

So, I am inclined towards updating this PR with approach (1) of updating CurrentEULAVersion with a new major.minor.

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, 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?

@anujc25
Copy link
Contributor Author

anujc25 commented Apr 30, 2024

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.

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.

I like the new handling of the EULA re-prompt 👍

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, thanks.

@anujc25 anujc25 merged commit 193b6f5 into vmware-tanzu:main May 1, 2024
7 checks passed
@anujc25 anujc25 added the docs-impact issues with documentation impact label May 1, 2024
vuil pushed a commit to vuil/tanzu-cli that referenced this pull request May 1, 2024
…om.com` (vmware-tanzu#755)

* Switch default registry to projects.packages.broadcom.com

* Update CurrentEULAVersion to re-prompt EULA to the users
vuil pushed a commit that referenced this pull request May 1, 2024
…om.com` (#755)

* Switch default registry to projects.packages.broadcom.com

* Update CurrentEULAVersion to re-prompt EULA to the users
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-not-required docs-impact issues with documentation impact
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants