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
35
stars
22
forks
source link
Skip plugin-group verification when TANZU_CLI_SKIP_PLUGIN_GROUP_VERIF… #729
This PR provides a means to skip the plugin group verification of whether the plugins specified in the plugin-group are available in the database or not.
If TANZU_CLI_SKIP_PLUGIN_GROUP_VERIFICATION_ON_PUBLISH is set to true while publishing the plugin-group, publishing process will bypass the plugin validation and continue with the plugin-group publishing.
2024-04-10T11:16:32-07:00 [i] created database locally at: "/var/folders/xc/12mmbpb50qxfb3ch8vv9nvwm0000gq/T/plugin_inventory.db"
2024-04-10T11:16:32-07:00 [i] publishing database at: "localhost:5001/test/v1/tanzu-cli/plugins/plugin-inventory:latest"
2024-04-10T11:16:33-07:00 [i] successfully published plugin inventory database
- Run plugin-group creation without publishing the plugins. It should fail.
make inventory-plugin-group-add PLUGIN_GROUP_NAME_VERSION="default:v0.0.4" PLUGIN_GROUP_DESCRIPTION="THIS IS A Test desc"
/Users/anujc/Documents/code/tanzu-cli/bin/builder inventory plugin-group add \
--repository localhost:5001/test/v1/tanzu-cli/plugins \
--plugin-inventory-image-tag latest \
--publisher tanzucli \
--vendor vmware \
--manifest /Users/anujc/Documents/code/tanzu-cli/artifacts/plugins/plugin_group_manifest.yaml \
--name default \
--version v0.0.4 \
--plugin-inventory-db-file "" \
--description "THIS IS A Test desc" \
2024-04-10T11:16:44-07:00 [i] pulling plugin inventory database from: "localhost:5001/test/v1/tanzu-cli/plugins/plugin-inventory:latest"
2024-04-10T11:16:44-07:00 [i] updating plugin inventory database with plugin group entry
Error: error while inserting plugin group 'default': specified plugin 'name:builder', 'target:global', 'version:v1' is not present in the database
2024-04-10T11:16:44-07:00 [x] : error while inserting plugin group 'default': specified plugin 'name:builder', 'target:global', 'version:v1' is not present in the database
make: *** [inventory-plugin-group-add] Error 1
- Re-run the plugin-group publishing with export `TANZU_CLI_SKIP_PLUGIN_GROUP_VERIFICATION_ON_PUBLISH=true` env specified.
$ make inventory-plugin-group-add PLUGIN_GROUP_NAME_VERSION="default:v0.0.4" PLUGIN_GROUP_DESCRIPTION="THIS IS A Test desc"
/Users/anujc/Documents/code/tanzu-cli/bin/builder inventory plugin-group add \
--repository localhost:5001/test/v1/tanzu-cli/plugins \
--plugin-inventory-image-tag latest \
--publisher tanzucli \
--vendor vmware \
--manifest /Users/anujc/Documents/code/tanzu-cli/artifacts/plugins/plugin_group_manifest.yaml \
--name default \
--version v0.0.4 \
--plugin-inventory-db-file "" \
--description "THIS IS A Test desc" \
<!-- 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
None
…ICATION_ON_PUBLISH is specified
What this PR does / why we need it
TANZU_CLI_SKIP_PLUGIN_GROUP_VERIFICATION_ON_PUBLISH
is set totrue
while publishing the plugin-group, publishing process will bypass the plugin validation and continue with the plugin-group publishing.Which issue(s) this PR fixes
Fixes #
Describe testing done for PR
Start new local registry
Initialize inventory database
2024-04-10T11:16:32-07:00 [i] created database locally at: "/var/folders/xc/12mmbpb50qxfb3ch8vv9nvwm0000gq/T/plugin_inventory.db" 2024-04-10T11:16:32-07:00 [i] publishing database at: "localhost:5001/test/v1/tanzu-cli/plugins/plugin-inventory:latest" 2024-04-10T11:16:33-07:00 [i] successfully published plugin inventory database
make inventory-plugin-group-add PLUGIN_GROUP_NAME_VERSION="default:v0.0.4" PLUGIN_GROUP_DESCRIPTION="THIS IS A Test desc" /Users/anujc/Documents/code/tanzu-cli/bin/builder inventory plugin-group add \ --repository localhost:5001/test/v1/tanzu-cli/plugins \ --plugin-inventory-image-tag latest \ --publisher tanzucli \ --vendor vmware \ --manifest /Users/anujc/Documents/code/tanzu-cli/artifacts/plugins/plugin_group_manifest.yaml \ --name default \ --version v0.0.4 \ --plugin-inventory-db-file "" \ --description "THIS IS A Test desc" \
2024-04-10T11:16:44-07:00 [i] pulling plugin inventory database from: "localhost:5001/test/v1/tanzu-cli/plugins/plugin-inventory:latest" 2024-04-10T11:16:44-07:00 [i] updating plugin inventory database with plugin group entry Error: error while inserting plugin group 'default': specified plugin 'name:builder', 'target:global', 'version:v1' is not present in the database 2024-04-10T11:16:44-07:00 [x] : error while inserting plugin group 'default': specified plugin 'name:builder', 'target:global', 'version:v1' is not present in the database make: *** [inventory-plugin-group-add] Error 1
$ make inventory-plugin-group-add PLUGIN_GROUP_NAME_VERSION="default:v0.0.4" PLUGIN_GROUP_DESCRIPTION="THIS IS A Test desc" /Users/anujc/Documents/code/tanzu-cli/bin/builder inventory plugin-group add \ --repository localhost:5001/test/v1/tanzu-cli/plugins \ --plugin-inventory-image-tag latest \ --publisher tanzucli \ --vendor vmware \ --manifest /Users/anujc/Documents/code/tanzu-cli/artifacts/plugins/plugin_group_manifest.yaml \ --name default \ --version v0.0.4 \ --plugin-inventory-db-file "" \ --description "THIS IS A Test desc" \
2024-04-10T11:17:07-07:00 [i] pulling plugin inventory database from: "localhost:5001/test/v1/tanzu-cli/plugins/plugin-inventory:latest" 2024-04-10T11:17:07-07:00 [i] updating plugin inventory database with plugin group entry 2024-04-10T11:17:07-07:00 [i] publishing plugin inventory database
Additional information
Special notes for your reviewer