forked from vmware-tanzu/tanzu-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement plugin-group publishing tooling with builder plugin (vmware…
…-tanzu#123) * Implement plugin-group publishing tooling with builder plugin Implements following commands: - `tanzu builder inventory plugin-group add` - `tanzu builder inventory plugin-group activate` - `tanzu builder inventory plugin-group deactivate` The change also updates `tanzu builder plugin build` to take additional input flag `--plugin-scope-association-file`. If this flag is provided the build process will automatically generate a plugin-group-manifest.yaml file within the provided `--binary-artifacts` directory. The change also implements `InsertPluginGroup` and `UpdatePluginGroupActivationState` APIs in the plugininventory package Update `cmd/plugin/builder/README.md` with the new commands. Only install mandatory plugins using the plugin group install
- Loading branch information
Showing
21 changed files
with
1,447 additions
and
132 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// Copyright 2023 VMware, Inc. All Rights Reserved. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
package inventory | ||
|
||
import ( | ||
"path/filepath" | ||
|
||
"github.com/pkg/errors" | ||
|
||
"github.com/vmware-tanzu/tanzu-cli/cmd/plugin/builder/imgpkg" | ||
"github.com/vmware-tanzu/tanzu-cli/pkg/plugininventory" | ||
) | ||
|
||
func inventoryDBDownload(imgpkgOptions imgpkg.ImgpkgWrapper, pluginInventoryDBImage, tempDir string) (string, error) { | ||
err := imgpkgOptions.PullImage(pluginInventoryDBImage, tempDir) | ||
if err != nil { | ||
return "", errors.Wrapf(err, "error while pulling database from the image: %q", pluginInventoryDBImage) | ||
} | ||
return filepath.Join(tempDir, plugininventory.SQliteDBFileName), nil | ||
} | ||
|
||
func inventoryDBUpload(imgpkgOptions imgpkg.ImgpkgWrapper, pluginInventoryDBImage, dbFile string) error { | ||
err := imgpkgOptions.PushImage(pluginInventoryDBImage, dbFile) | ||
if err != nil { | ||
return errors.Wrapf(err, "error while publishing inventory database to the repository as image: %q", pluginInventoryDBImage) | ||
} | ||
return nil | ||
} |
Oops, something went wrong.