portainer/api/pkg/libhelm/manager.go

23 lines
633 B
Go
Raw Normal View History

2022-11-30 01:25:47 +00:00
package libhelm
import (
"errors"
"github.com/portainer/portainer/pkg/libhelm/binary"
2022-11-30 01:25:47 +00:00
)
// HelmConfig is a struct that holds the configuration for the Helm package manager
type HelmConfig struct {
BinaryPath string `example:"/portainer/dist"`
}
var errBinaryPathNotSpecified = errors.New("binary path not specified")
// NewHelmPackageManager returns a new instance of HelmPackageManager based on HelmConfig
func NewHelmPackageManager(config HelmConfig) (HelmPackageManager, error) {
if config.BinaryPath != "" {
return binary.NewHelmBinaryPackageManager(config.BinaryPath), nil
}
return nil, errBinaryPathNotSpecified
}