helmclient

package
v1.18.0 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2023 License: Apache-2.0 Imports: 41 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HelmPluginsDirectory = "/app/.helm/helmplugin"
)

Variables

This section is empty.

Functions

func MergeOverrideValues added in v1.5.0

func MergeOverrideValues(valuesYaml, defaultValues, overrideYaml, overrideValues string, imageKvs []*KV) (string, error)

MergeOverrideValues merge override yaml and override kvs defaultValues overrideYaml used for -f option overrideValues used for --set option

Types

type HelmClient

type HelmClient struct {
	*hc.HelmClient

	Namespace string

	RestConfig *rest.Config
	// contains filtered or unexported fields
}

func NewClient added in v1.9.9

func NewClient() (*HelmClient, error)

NewClient returns a new Helm client with no construct parameters used to update helm repo data and download index.yaml or helm charts

func NewClientFromNamespace added in v1.9.9

func NewClientFromNamespace(clusterID, namespace string) (*HelmClient, error)

NewClientFromNamespace returns a new Helm client constructed with the provided clusterID and namespace a kubeClient will be initialized to support necessary k8s operations when install/upgrade helm charts

func NewClientFromRestConf

func NewClientFromRestConf(restConfig *rest.Config, ns string) (*HelmClient, error)

NewClientFromRestConf returns a new Helm client constructed with the provided REST config options used to list/uninstall helm release

func (*HelmClient) Clone added in v1.9.9

func (hClient *HelmClient) Clone() (*HelmClient, error)

NOTE: When using this method, pay attention to whether restConfig is present in the original client.

func (*HelmClient) DownloadChart added in v1.9.9

func (hClient *HelmClient) DownloadChart(repoEntry *repo.Entry, chartRef string, chartVersion string, destDir string, unTar bool) error

DownloadChart works like executing `helm pull repoName/chartName --version=version' since pulling from OCI Registry is still considered as an EXPERIMENTAL feature we DO NOT support pulling charts by pulling OCI Artifacts from OCI Registry NOTE consider using os.execCommand('helm pull') to reduce code complexity of offering compatibility since third-party plugins CANNOT be used as SDK if unTar is true, no need to mkdir for destDir if unTar is no, your need to mkdir for destDir yourself

func (*HelmClient) FetchIndexYaml added in v1.9.9

func (hClient *HelmClient) FetchIndexYaml(repoEntry *repo.Entry) (*repo.IndexFile, error)

FetchIndexYaml fetch index.yaml from remote chart repo `helm repo add` and `helm repo update` will be executed

func (*HelmClient) GetChartValues added in v1.9.9

func (hClient *HelmClient) GetChartValues(repoEntry *repo.Entry, projectName, releaseName, chartRepo, chartName, chartVersion string) (string, error)

func (*HelmClient) InstallOrUpgradeChart

func (hClient *HelmClient) InstallOrUpgradeChart(ctx context.Context, spec *hc.ChartSpec, opts *hc.GenericHelmOptions) (*release.Release, error)

InstallOrUpgradeChart install or upgrade helm chart, use the same rule with helm to determine weather to install or upgrade

func (*HelmClient) PushChart added in v1.9.9

func (hClient *HelmClient) PushChart(repoEntry *repo.Entry, chartPath string) error

func (*HelmClient) UpdateChartRepo added in v1.9.9

func (hClient *HelmClient) UpdateChartRepo(repoEntry *repo.Entry) (string, error)

UpdateChartRepo works like executing `helm repo update` environment `HELM_REPO_USERNAME` and `HELM_REPO_PASSWORD` are only required for ali acr repos

type KV added in v1.5.0

type KV struct {
	Key   string      `json:"key"`
	Value interface{} `json:"value"`
}

Jump to

Keyboard shortcuts

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