Documentation ¶
Index ¶
- Constants
- func MergeOverrideValues(valuesYaml, defaultValues, overrideYaml, overrideValues string, imageKvs []*KV) (string, error)
- type HelmClient
- func (hClient *HelmClient) Clone() (*HelmClient, error)
- func (hClient *HelmClient) DownloadChart(repoEntry *repo.Entry, chartRef string, chartVersion string, destDir string, ...) error
- func (hClient *HelmClient) FetchIndexYaml(repoEntry *repo.Entry) (*repo.IndexFile, error)
- func (hClient *HelmClient) GetChartValues(repoEntry *repo.Entry, ...) (string, error)
- func (hClient *HelmClient) InstallOrUpgradeChart(ctx context.Context, spec *hc.ChartSpec, opts *hc.GenericHelmOptions) (*release.Release, error)
- func (hClient *HelmClient) PushChart(repoEntry *repo.Entry, chartPath string) error
- func (hClient *HelmClient) UpdateChartRepo(repoEntry *repo.Entry) (string, error)
- type KV
Constants ¶
const (
HelmPluginsDirectory = "/app/.helm/helmplugin"
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type HelmClient ¶
type HelmClient struct { *hc.HelmClient Namespace string RestConfig *rest.Config // contains filtered or unexported fields }
func NewClient ¶
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 ¶
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 only used to list/uninstall helm release because kubeClient is nil
func (*HelmClient) Clone ¶
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 ¶
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 ¶
FetchIndexYaml fetch index.yaml from remote chart repo `helm repo add` and `helm repo update` will be executed
func (*HelmClient) GetChartValues ¶
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 ¶
func (hClient *HelmClient) PushChart(repoEntry *repo.Entry, chartPath string) error
func (*HelmClient) UpdateChartRepo ¶
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