helm

package
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 15, 2024 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EnvHelmNamespace         = "HELM_NAMESPACE"
	EnvHelmDriver            = "HELM_DRIVER"
	EnvHelmDebug             = "HELM_DEBUG"
	EnvLocalChartPath        = "LOCAL_CHART_PATH"
	EnvLocalChartDiscoverDir = "LOCAL_CHART_DISCOVER_DIR"
	DefaultChartSuffix       = ".tgz"
)
View Source
const (
	ActionInstall = iota
	ActionUpgrade
	ActionUninstall
)

Variables

This section is empty.

Functions

func ParseValues

func ParseValues(preValues map[string]string) string

Types

type ChartSpec

type ChartSpec struct {
	ReleaseName string
	ChartName   string
	Version     string
	Action      int
	// overwrite values.yaml from chart, only use for install action
	// like: key=value,key.nKey.value; you can use ParseValues convert map to values
	Values string
}

type Client

type Client struct {
	// contains filtered or unexported fields
}

func (*Client) AddOrUpdateRepo

func (c *Client) AddOrUpdateRepo(repoEntry *repo.Entry) error

AddOrUpdateRepo Add or update repo from repo config

func (*Client) GetReleaseHistory

func (c *Client) GetReleaseHistory(releaseName string) ([]*release.Release, error)

GetReleaseHistory check release installed or not

func (*Client) InstallRelease

func (c *Client) InstallRelease(releaseName, chartName, version string, values ...string) error

InstallRelease install release

func (*Client) UninstallRelease

func (c *Client) UninstallRelease(releaseName string) error

UninstallRelease uninstall release which deployed

func (*Client) UpgradeRelease

func (c *Client) UpgradeRelease(releaseName, localRepoName, targetVersion string) error

UpgradeRelease upgrade release version

type Helm

type Helm interface {
	AddOrUpdateRepo(repoEntry *repo.Entry) error
	GetReleaseHistory(releaseName string) ([]*release.Release, error)
	InstallRelease(releaseName, chartName, version string, values ...string) error
	UninstallRelease(releaseName string) error
	UpgradeRelease(releaseName, localRepoName, targetVersion string) error
}

func New

func New(options ...Option) (Helm, error)

New new Helm Interface

type Manager

type Manager struct {
	Charts        []*ChartSpec
	HelmClient    Helm
	LocalRepoName string
	TimeOut       time.Duration
}

func (*Manager) ActionExecute

func (m *Manager) ActionExecute(chart *ChartSpec) error

func (*Manager) Execute

func (m *Manager) Execute() error

type Option

type Option func(client *Client)

func WithLocalChartDiscoverDir

func WithLocalChartDiscoverDir(path string) Option

WithLocalChartDiscoverDir with local chart discover dir

func WithRESTClientGetter

func WithRESTClientGetter(getter *RESTClientGetterImpl) Option

WithRESTClientGetter with custom rest client getter, use rest.Config to visit Kubernetes

type RESTClientGetterImpl

type RESTClientGetterImpl struct {
	// contains filtered or unexported fields
}

RESTClientGetterImpl impl genericclioptions.RESTClientGetter

func NewRESTClientGetterImpl

func NewRESTClientGetterImpl(rc *rest.Config) *RESTClientGetterImpl

NewRESTClientGetterImpl new RESTClientGetterImpl

func (*RESTClientGetterImpl) ToDiscoveryClient

func (*RESTClientGetterImpl) ToRESTConfig

func (r *RESTClientGetterImpl) ToRESTConfig() (*rest.Config, error)

func (*RESTClientGetterImpl) ToRESTMapper

func (r *RESTClientGetterImpl) ToRESTMapper() (meta.RESTMapper, error)

func (*RESTClientGetterImpl) ToRawKubeConfigLoader

func (r *RESTClientGetterImpl) ToRawKubeConfigLoader() clientcmd.ClientConfig

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL