mirror of
https://github.com/portainer/portainer.git
synced 2025-07-24 07:49:41 +02:00
import libhelm into portainer (#8128)
This commit is contained in:
parent
241440a474
commit
d2f6d1e415
32 changed files with 1305 additions and 5 deletions
22
api/pkg/libhelm/manager.go
Normal file
22
api/pkg/libhelm/manager.go
Normal file
|
@ -0,0 +1,22 @@
|
|||
package libhelm
|
||||
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"github.com/portainer/libhelm/binary"
|
||||
)
|
||||
|
||||
// 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
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue