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

Add backward compatibility support for private customer plugins #289

Merged
merged 1 commit into from
May 16, 2023

Conversation

prkalle
Copy link
Contributor

@prkalle prkalle commented May 15, 2023

What this PR does / why we need it

This PR adds backward compatiblity support for private customer plugins

Summary:

  • This is to support a case where, when a user using CLI prior to Central repository support, used CLIPlugin CR to download the custom private plugins hosted on their private repository. This is just to provide the backward compatibility and not for general usage.
  • User should use the environment variable TANZU_CLI_PRIVATE_PLUGIN_DISCOVERY_IMAGES to specify the custom private repository where he hosted his custom plugins. Users who are currently using the CLIPlugin CR to point to their cutom private plugin repository, should use the CLI documentation to build and publish their plugins to their private repository so as to use this approach.
  • The newly introduced environment variable is same as TANZU_CLI_ADDITIONAL_PLUGIN_DISCOVERY_IMAGES_TEST_ONLY except the name change and the new environment TANZU_CLI_PRIVATE_PLUGIN_DISCOVERY_IMAGESvariable would be mutual exclusive to TANZU_CLI_ADDITIONAL_PLUGIN_DISCOVERY_IMAGES_TEST_ONLY (only one of them would be honored) with TANZU_CLI_PRIVATE_PLUGIN_DISCOVERY_IMAGES taking the priority.

Which issue(s) this PR fixes

Fixes #

Describe testing done for PR

Ran the tanzu plugin search and it shows only the test and build plugin from default plugin source

❯ ./bin/tanzu plugin search
  NAME     DESCRIPTION             TARGET  LATEST
  builder  Build Tanzu components  global  v0.90.0-alpha.1
  test     Test the CLI            global  v0.90.0-alpha.1
❯ ./bin/tanzu plugin source list
  NAME     IMAGE
  default  projects.registry.vmware.com/tanzu_cli_stage/plugins/plugin-inventory:latest
❯
❯

Exported the new environment variable TANZU_CLI_PRIVATE_PLUGIN_DISCOVERY_IMAGES by pointing it to the additional repositories and tanzu plugin search command shows the additional plugins as well.

❯ tanzu config set env.TANZU_CLI_PRIVATE_PLUGIN_DISCOVERY_IMAGES localhost:9876/tanzu-cli/plugins/sandbox1:small
❯
❯
❯ ./bin/tanzu plugin search
  NAME                DESCRIPTION                  TARGET           LATEST
  builder             Build Tanzu components       global           v0.90.0-alpha.1
  test                Test the CLI                 global           v0.90.0-alpha.1
  cluster             Desc for cluster             kubernetes       v11.11.11
  feature             Desc for feature             kubernetes       v11.11.11
  kubernetes-release  Desc for kubernetes-release  kubernetes       v11.11.11
  management-cluster  Desc for management-cluster  kubernetes       v11.11.11
  package             Desc for package             kubernetes       v11.11.11
  secret              Desc for secret              kubernetes       v11.11.11
  telemetry           Desc for telemetry           kubernetes       v11.11.11
  account             Desc for account             mission-control  v11.11.11
  apply               Desc for apply               mission-control  v11.11.11
  audit               Desc for audit               mission-control  v11.11.11
  cluster             Desc for cluster             mission-control  v11.11.11
  clustergroup        Desc for clustergroup        mission-control  v11.11.11
  continuousdelivery  Desc for continuousdelivery  mission-control  v11.11.11
  data-protection     Desc for data-protection     mission-control  v11.11.11
  ekscluster          Desc for ekscluster          mission-control  v11.11.11
  events              Desc for events              mission-control  v11.11.11
  helm                Desc for helm                mission-control  v11.11.11
  iam                 Desc for iam                 mission-control  v11.11.11
  inspection          Desc for inspection          mission-control  v11.11.11
  integration         Desc for integration         mission-control  v11.11.11
  management-cluster  Desc for management-cluster  mission-control  v11.11.11
  policy              Desc for policy              mission-control  v11.11.11
  secret              Desc for secret              mission-control  v11.11.11
  tanzupackage        Desc for tanzupackage        mission-control  v11.11.11
  workspace           Desc for workspace           mission-control  v11.11.11

Installing the plugin from the additional plugin source was successful

❯ ./bin/tanzu plugin install feature
[i] Installing plugin 'feature:v11.11.11' with target 'kubernetes'
[ok] successfully installed 'feature' plugin

Release note

Add backward compatibility support for private customer plugins

Additional information

Special notes for your reviewer

@prkalle prkalle requested a review from a team as a code owner May 15, 2023 22:21
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.

Thanks @prkalle.
LGTM

pkg/config/defaults_test.go Show resolved Hide resolved
pkg/pluginmanager/manager.go Show resolved Hide resolved
- This is to support a case where, when a user using CLI prior to Central repository support, used CLIPlugin CR to download the custom private plugins hosted on their private repository. This is just to provide the backward compatibility and not for general usage.

Signed-off-by: Prem Kumar Kalle <pkalle@vmware.com>
@prkalle prkalle force-pushed the add/CLIPlugin_private_repo branch from f412b04 to 6017200 Compare May 16, 2023 03:51
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. Thanks for adding this.

@prkalle prkalle merged commit 97904a3 into vmware-tanzu:main May 16, 2023
@marckhouzam marckhouzam added this to the v0.90.0 milestone Oct 20, 2023
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