helm

package
v0.0.0-...-0e2c39a Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2024 License: UPL-1.0 Imports: 33 Imported by: 0

Documentation

Index

Constants

View Source
const ReleaseNotFound = "NotFound"
View Source
const ReleaseStatusDeployed = "deployed"
View Source
const ReleaseStatusFailed = "failed"

Variables

This section is empty.

Functions

func CreateActionConfig

func CreateActionConfig(includeRelease bool, releaseName string, releaseStatus release.Status, createReleaseFn CreateReleaseFnType) (*action.Configuration, error)

func FindLatestChartVersion

func FindLatestChartVersion(chartName, repoName, repoURI string) (string, error)

FindLatestChartVersion Finds the most recent ChartVersion

func GetAllValues

func GetAllValues(kubeInfo *client.KubeInfo, releaseName string, namespace string) ([]byte, error)

GetAllValues will run 'helm get values -a' command and return the output from the command.

func GetAllValuesMap

func GetAllValuesMap(kubeInfo *client.KubeInfo, releaseName string, namespace string) (map[string]interface{}, error)

GetAllValuesMap will run 'helm get values -a' command and return the output from the command.

func GetHelmReleaseStatus

func GetHelmReleaseStatus(kubeInfo *client.KubeInfo, releaseName string, namespace string) (string, error)

GetHelmReleaseStatus extracts the Helm deployment status of the specified chart from the JSON output as a string

func GetMetadata

func GetMetadata(kubeInfo *client.KubeInfo, releaseName string, namespace string) (*action.Metadata, error)

GetMetadata will run 'helm get metadata' command and return the output from the command.

func GetRelease

func GetRelease(kubeInfo *client.KubeInfo, releaseName string, namespace string) (*release.Release, error)

GetRelease will run 'helm get all' command and return the output from the command.

func GetReleaseAppVersion

func GetReleaseAppVersion(kubeInfo *client.KubeInfo, releaseName string, namespace string) (string, error)

GetReleaseAppVersion - public function to execute releaseAppVersionFn

func GetReleaseChartVersion

func GetReleaseChartVersion(kubeInfo *client.KubeInfo, releaseName string, namespace string) (string, error)

GetReleaseChartVersion extracts the chart version from a deployed helm release

func GetReleaseStatus

func GetReleaseStatus(kubeInfo *client.KubeInfo, releaseName string, namespace string) (status string, err error)

GetReleaseStatus returns the helmRelease status

func GetReleaseStringValues

func GetReleaseStringValues(kubeInfo *client.KubeInfo, valueKeys []string, releaseName string, namespace string) (map[string]string, error)

GetReleaseStringValues - Returns a subset of Helm helmRelease values as a map of strings

func GetReleaseValues

func GetReleaseValues(kubeInfo *client.KubeInfo, valueKeys []string, releaseName string, namespace string) (map[string]interface{}, error)

GetReleaseValues - Returns a subset of Helm helmRelease values as a map of objects

func GetReleases

func GetReleases(kubeInfo *client.KubeInfo, namespace string) ([]*release.Release, error)

func GetReleasesAllNamespaces

func GetReleasesAllNamespaces(kubeInfo *client.KubeInfo) ([]*release.Release, error)

GetReleasesAllNamespaces gets the release information over all namespaces In the helm source code, the namespace for the envSettings and the configuration seem to be set to "" when the --all-namespaces flag is used, so I am following that pattern

func GetShowValues

func GetShowValues(archive io.Reader) ([]byte, error)

GetShowValues returns the values.yaml file of a particular chart

func GetValues

func GetValues(kubeInfo *client.KubeInfo, releaseName string, namespace string) ([]byte, error)

GetValues will run 'helm get values' command and return the output from the command.

func GetValuesMap

func GetValuesMap(kubeInfo *client.KubeInfo, releaseName string, namespace string) (map[string]interface{}, error)

GetValuesMap will run 'helm get values' command and return the output from the command.

func HelmValueFileConstructor

func HelmValueFileConstructor(kvs []KeyValue) (string, error)

HelmValueFileConstructor creates a YAML file from a set of key value pairs

func IsReleaseDeployed

func IsReleaseDeployed(kubeInfo *client.KubeInfo, releaseName string, namespace string) (found bool, err error)

IsReleaseDeployed returns true if the helmRelease is deployed

func IsReleaseFailed

func IsReleaseFailed(kubeInfo *client.KubeInfo, releaseName string, namespace string) (bool, error)

IsReleaseFailed Returns true if the chart helmRelease state is marked 'failed'

func IsReleaseInstalled

func IsReleaseInstalled(kubeInfo *client.KubeInfo, releaseName string, namespace string) (found bool, err error)

IsReleaseInstalled returns true if the helmRelease is installed

func MergeMaps

func MergeMaps(mBase map[string]interface{}, mOverlay map[string]interface{}) error

MergeMaps merges two maps where mOverlay overrides mBase

func MergeValues

func MergeValues(overrides []HelmOverrides, p getter.Providers) (map[string]interface{}, error)

MergeValues merges values from the specified overrides

func NewGitGetter

func NewGitGetter(options ...getter.Option) (getter.Getter, error)

NewGitGetter constructs a valid git client as a Getter

func NewGitProvider

func NewGitProvider() getter.Provider

NewGitProvider returns a provider struct that contains a scheme and a construction for a GitGetter struct

func SetActionConfigFunction

func SetActionConfigFunction(f ActionConfigFnType)

func SetChartInfoFunction

func SetChartInfoFunction(f ChartInfoFnType)

SetChartInfoFunction Override the chart info function for unit testing

func SetDefaultActionConfigFunction

func SetDefaultActionConfigFunction()

SetDefaultActionConfigFunction Resets the action config function

func SetDefaultChartInfoFunction

func SetDefaultChartInfoFunction()

SetDefaultChartInfoFunction Reset the chart info function

func SetDefaultLoadChartFunction

func SetDefaultLoadChartFunction()

func SetLoadChartFunction

func SetLoadChartFunction(f LoadChartFnType)

func Template

func Template(kubeInfo *client.KubeInfo, theChart *chart.Chart, overrides []HelmOverrides, k8sVersion *semver.Version) (string, error)

Template templates a chart using the provided overrides and returns the generated yamls as a string

func Uninstall

func Uninstall(kubeInfo *client.KubeInfo, releaseName string, namespace string, dryRun bool) (err error)

Uninstall will uninstall the helmRelease in the specified namespace using helm uninstall

func UpgradeChart

func UpgradeChart(kubeInfo *client.KubeInfo, releaseName string, namespace string, createNamespace bool, theChart *chart.Chart, wait bool, dryRun bool, overrides []HelmOverrides, resetValues bool) (*release.Release, error)

UpgradeChart installs a release into a cluster or upgrades an existing one.

func UpgradeChartFromArchive

func UpgradeChartFromArchive(kubeInfo *client.KubeInfo, releaseName string, namespace string, createNamespace bool, archive io.Reader, wait bool, dryRun bool, overrides []HelmOverrides, resetValues bool) (*release.Release, error)

UpgradeChartFromArchive installs a release into a cluster or upgrades an existing one. The reader must be a compressed tar archive.

Types

type ActionConfigFnType

type ActionConfigFnType func(kubeInfo *client.KubeInfo, namespace string) (*action.Configuration, error)

type ChartInfo

type ChartInfo struct {
	APIVersion  string
	Description string
	Name        string
	Version     string
	AppVersion  string
}

ChartInfo contains Helm Chart.yaml data

func GetChartInfo

func GetChartInfo(chartDir string) (ChartInfo, error)

GetChartInfo - public entry point

type ChartInfoFnType

type ChartInfoFnType func(chartDir string) (ChartInfo, error)

ChartInfoFnType - Package-level var and functions to allow overriding getReleaseState for unit test purposes

type ChartStatusFnType

type ChartStatusFnType func(releaseName string, namespace string) (string, error)

ChartStatusFnType - Package-level var and functions to allow overriding GetChartStatus for unit test purposes

type CreateReleaseFnType

type CreateReleaseFnType func(name string, releaseStatus release.Status) *release.Release

type GitGetter

type GitGetter struct {
}

GitGetter is a struct that implements the Getter interface

func (GitGetter) Get

func (g GitGetter) Get(url string, options ...getter.Option) (*bytes.Buffer, error)

Get goes to a url in the format of git+http[s]://provider/organization/repo&/path-to-file?[tag,branch,commit]=value or in the format of git+ssh://username@provider/organization/repo&/path-to-file?[tag,branch,commit]=value and clones that repo, opens it in memory and returns the contents of the specified file This format was inspired from https://github.com/aslafy-z/helm-git

type HelmOverrides

type HelmOverrides struct {
	LiteralOverride    string // literal yaml
	SetOverrides       string // for --set
	SetStringOverrides string // for --set-string
	SetFileOverrides   string // for --set-file
	FileOverride       string // for -f
}

HelmOverrides contains all the overrides that gets passed to the helm cli runner

type HelmReleaseOpts

type HelmReleaseOpts struct {
	RepoURL      string
	ReleaseName  string
	Namespace    string
	ChartPath    string
	ChartVersion string
	Overrides    []HelmOverrides

	Username string
	Password string
}

type KeyValue

type KeyValue struct {
	Key       string
	Value     string
	SetString bool // for --set-string
	SetFile   bool // for --set-file
	IsFile    bool // for -f
}

KeyValue defines the Key, Value pair used to override a single helm Value

type LoadChartFnType

type LoadChartFnType func(chartDir string) (*chart.Chart, error)

type RestGetter

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

Jump to

Keyboard shortcuts

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