1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-24 15:59:41 +02:00

feat(libhelm) import libhelm into CE pkg directory [EE-4650] (#8138)

* import libhelm and update some paths

* remove file

* update readme
This commit is contained in:
Matt Hook 2022-12-01 14:27:49 +13:00 committed by GitHub
parent 9cdc0da615
commit 4fee359247
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
29 changed files with 1328 additions and 0 deletions

View file

@ -0,0 +1,29 @@
package binary
import (
"github.com/pkg/errors"
"github.com/portainer/portainer/pkg/libhelm/options"
)
var errRequiredShowOptions = errors.New("chart, repo and output format are required")
// Show runs `helm show <command> <chart> --repo <repo>` with specified show options.
// The show options translate to CLI arguments which are passed in to the helm binary when executing install.
func (hbpm *helmBinaryPackageManager) Show(showOpts options.ShowOptions) ([]byte, error) {
if showOpts.Chart == "" || showOpts.Repo == "" || showOpts.OutputFormat == "" {
return nil, errRequiredShowOptions
}
args := []string{
string(showOpts.OutputFormat),
showOpts.Chart,
"--repo", showOpts.Repo,
}
result, err := hbpm.run("show", args)
if err != nil {
return nil, errors.Wrap(err, "failed to run helm show on specified args")
}
return result, nil
}