-
Notifications
You must be signed in to change notification settings - Fork 22
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 support for selective plugin migration using plugin groups for air-gapped environments #231
Add support for selective plugin migration using plugin groups for air-gapped environments #231
Conversation
5ab4263
to
87bfcf2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm going through this. Very nice! Some first comments.
There are some comments about "hidden" plugins, but maybe for alpha.1, we can simply ignore hidden plugins/groups if we don't have time to handle them properly.
return nil, nil, errors.Errorf("incorrect plugin group %q specified", pgName) | ||
} | ||
pgFilter := plugininventory.PluginGroupFilter{ | ||
IncludeHidden: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you put a comment on why we include hidden? I assume it is something like: "If the user explicitly specified a group that is hidden, we should respect that".
Should we require the new TANZU_CLI_INCLUDE_DEACTIVATED_PLUGINS_TEST_ONLY
to be set before allowing to get hidden groups/plugins? Once #219 is merged
|
||
// If groups were not provided as argument select all available plugin groups and all available plugins | ||
if len(o.Groups) == 0 { | ||
selectedPluginGroups, err = pi.GetPluginGroups(plugininventory.PluginGroupFilter{}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since you allow hidden groups below, should we also allow including hidden groups if the new TANZU_CLI_INCLUDE_DEACTIVATED_PLUGINS_TEST_ONLY
is set? Once #219 is merged
pif := &plugininventory.PluginInventoryFilter{ | ||
Name: p.Name, | ||
Target: p.Target, | ||
Version: p.Version, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to handle hidden plugins here, if we allow for hidden groups
080922a
to
e4dbf8f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One more file to go, but here are the last few nits.
// `plugin-inventory` if withTag is false | ||
func GetImageRelativePath(image, basePath string, withTag bool) string { | ||
relativePath := strings.TrimPrefix(image, basePath) | ||
if withTag { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if withTag == true
but the image
does not have a tag? Should we append :latest
?
I don't know if this could even happen but I thought about it because the function above does add :latest
if the tag is not specified.
0dc412f
to
b625ab1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is really great!
Just some last comments about cleaning up temp directories and then it looks good!
689843a
to
205e7dd
Compare
…ents This change adds support for users to do partial migration of plugins using plugin groups instead of migrating all available plugins. - Allows users to pass `--group` flag with `tanzu plugin download-bundle` to do selective plugin download and generates tar file - Users can use the generated tar file with the `tanzu plugin upload-bundle` command to do partial plugin migration
205e7dd
to
d822e47
Compare
d822e47
to
bafcefc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Thanks for this great feature in such a short time! 🚀
…r-gapped environments (#231) * Selective plugin migration using plugin groups for airgapped environments This change adds support for users to do partial migration of plugins using plugin groups instead of migrating all available plugins. - Allows users to pass `--group` flag with `tanzu plugin download-bundle` to do selective plugin download and generates tar file - Users can use the generated tar file with the `tanzu plugin upload-bundle` command to do partial plugin migration
What this PR does / why we need it
--group
flag withtanzu plugin download-bundle
to do selective plugin download and generate tar filetanzu plugin upload-bundle
command to do partial plugin migrationCommand UX:
Implementation Details:
Considering the original plugin inventory database image is immutable and changing the content of that image has consequences regarding signature verification, the proposed approach uses an additional plugin-inventory-metadata image containing the SQLite baked
plugin_inventory_metadata.db
image to store available plugins and available plugin group information.If the actual plugin-inventory database gets published to
private_repo.mycompany.com/plugins/plugin-inventory:latest
then the additional oci image containing the metadata database will be published at
private_repo.mycompany.com/plugins/plugin-inventory-metadata:latest
.Workflow for
tanzu plugin download-bundle
command:plugin-inventory-image.tar.gz
--group
plugin-name_target_os_arch_version.tar.gz
plugin_inventory_metadata.db
based on the selectedPlugins and selectedPluginGroupsplugin_migration_manifest.yaml
with the metadata about all things that needs to be migratedtar.gz
file containing all the above content which can be used withupload-bundle
command.Workflow for
tanzu plugin upload-bundle
command:plugin_migration_manifest.yaml
filePending: (Will be done as part of a separate PR)
Which issue(s) this PR fixes
Related to #223
Describe testing done for PR
Release note
Additional information
Special notes for your reviewer