Documentation
¶
Index ¶
- Constants
- func IsCannotReuseRelease(err error) bool
- func IsEmptyChartTemplates(err error) bool
- func IsExecutionFailed(err error) bool
- func IsInvalidConfig(err error) bool
- func IsInvalidGZipHeader(err error) bool
- func IsNotFound(err error) bool
- func IsPullChartFailedError(err error) bool
- func IsPullChartNotFound(err error) bool
- func IsPullChartTimeout(err error) bool
- func IsReleaseAlreadyExists(err error) bool
- func IsReleaseNameInvalid(err error) bool
- func IsReleaseNotDeployed(err error) bool
- func IsReleaseNotFound(err error) bool
- func IsTarballNotFound(err error) bool
- func IsTestReleaseFailure(err error) bool
- func IsTestReleaseTimeout(err error) bool
- func IsTillerInvalidVersion(err error) bool
- func IsTillerNotFound(err error) bool
- func IsTillerNotRunningError(err error) bool
- func IsTillerOutdated(err error) bool
- func IsTooManyResults(err error) bool
- func IsYamlConversionFailed(err error) bool
- func MergeValues(destMap, srcMap map[string][]byte) (map[string]interface{}, error)
- type Chart
- type Client
- func (c *Client) DeleteRelease(ctx context.Context, releaseName string, options ...helmclient.DeleteOption) error
- func (c *Client) EnsureTillerInstalled(ctx context.Context) error
- func (c *Client) EnsureTillerInstalledWithValues(ctx context.Context, values []string) error
- func (c *Client) GetReleaseContent(ctx context.Context, releaseName string) (*ReleaseContent, error)
- func (c *Client) GetReleaseHistory(ctx context.Context, releaseName string) (*ReleaseHistory, error)
- func (c *Client) InstallReleaseFromTarball(ctx context.Context, path, ns string, options ...helmclient.InstallOption) error
- func (c *Client) ListReleaseContents(ctx context.Context) ([]*ReleaseContent, error)
- func (c *Client) LoadChart(ctx context.Context, chartPath string) (Chart, error)
- func (c *Client) PingTiller(ctx context.Context) error
- func (c *Client) PullChartTarball(ctx context.Context, tarballURL string) (string, error)
- func (c *Client) RunReleaseTest(ctx context.Context, releaseName string, ...) error
- func (c *Client) UpdateReleaseFromTarball(ctx context.Context, releaseName, path string, ...) error
- type Config
- type Interface
- type ReleaseContent
- type ReleaseHistory
Constants ¶
const ( PrometheusNamespace = "helmclient" PrometheusSubsystem = "library" )
Variables ¶
This section is empty.
Functions ¶
func IsCannotReuseRelease ¶
IsCannotReuseRelease asserts cannotReuseReleaseError.
func IsEmptyChartTemplates ¶
IsEmptyChartTemplates asserts emptyChartTemplatesError.
func IsExecutionFailed ¶
IsExecutionFailed asserts executionFailedError.
func IsInvalidConfig ¶
IsInvalidConfig asserts invalidConfigError.
func IsInvalidGZipHeader ¶
IsInvalidGZipHeader asserts invalidGZipHeaderError.
func IsPullChartFailedError ¶
IsPullChartFailedError asserts pullChartFailedError.
func IsPullChartNotFound ¶
IsPullChartNotFound asserts pullChartNotFoundError.
func IsPullChartTimeout ¶
IsPullChartTimeout asserts pullChartTimeoutError.
func IsReleaseAlreadyExists ¶
IsReleaseAlreadyExists asserts releaseAlreadyExistsError.
func IsReleaseNameInvalid ¶
IsReleaseNameInvalid asserts releaseNameInvalidError.
func IsReleaseNotDeployed ¶
IsReleaseNotDeployed asserts releaseNotDeployedError.
func IsReleaseNotFound ¶
IsReleaseNotFound asserts releaseNotFoundError.
func IsTarballNotFound ¶
IsTarballNotFound asserts tarballNotFoundError.
func IsTestReleaseFailure ¶
IsTestReleaseFailure asserts testReleaseFailureError.
func IsTestReleaseTimeout ¶
IsTestReleaseTimeout asserts testReleaseTimeoutError.
func IsTillerInvalidVersion ¶
IsTillerInvalidVersion asserts tillerInvalidVersionError.
func IsTillerNotFound ¶
IsTillerNotFound asserts tillerNotFoundError.
func IsTillerNotRunningError ¶
IsTillerNotRunningError asserts tillerNotRunningError.
func IsTillerOutdated ¶
IsTillerOutdated asserts tillerOutdatedError.
func IsTooManyResults ¶
IsTooManyResults asserts tooManyResultsError.
func IsYamlConversionFailed ¶
IsYamlConversionFailed asserts yamlConversionFailedError.
func MergeValues ¶
MergeValues merges config values so they can be used when installing or updating Helm releases. It takes in 2 maps with a string key and YAML values passed as a byte array.
A deep merge is performed into a single map[string]interface{} output. If a value is present in both then the source map is preferred.
The YAML values are parsed using yamlToStringMap. This is because the default behaviour of the YAML parser is to unmarshal into map[interface{}]interface{} which causes problems with the merge logic. See https://github.com/go-yaml/yaml/issues/139.
Types ¶
type Chart ¶
type Chart struct {
// Version is the version of the Helm Chart.
Version string
}
Chart returns information about a Helm Chart.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client knows how to talk with a Helm Tiller server.
func (*Client) DeleteRelease ¶
func (c *Client) DeleteRelease(ctx context.Context, releaseName string, options ...helmclient.DeleteOption) error
DeleteRelease uninstalls a chart given its release name.
func (*Client) EnsureTillerInstalled ¶
EnsureTillerInstalled installs Tiller by creating its deployment and waiting for it to start. A service account and cluster role binding are also created. As a first step, it checks if Tiller is already ready, in which case it returns early.
func (*Client) EnsureTillerInstalledWithValues ¶
EnsureTillerInstalledWithValues installs Tiller by creating its deployment and waiting for it to start. A service account and cluster role binding are also created. As a first step, it checks if Tiller is already ready, in which case it returns early. Values can be provided to pass through to Tiller and overwrite its deployment.
func (*Client) GetReleaseContent ¶
func (c *Client) GetReleaseContent(ctx context.Context, releaseName string) (*ReleaseContent, error)
GetReleaseContent gets the current status of the Helm Release including any values provided when the chart was installed. The releaseName is the name of the Helm Release that is set when the Helm Chart is installed.
func (*Client) GetReleaseHistory ¶
func (c *Client) GetReleaseHistory(ctx context.Context, releaseName string) (*ReleaseHistory, error)
GetReleaseHistory gets the current installed version of the Helm Release. The releaseName is the name of the Helm Release that is set when the Helm Chart is installed.
func (*Client) InstallReleaseFromTarball ¶
func (c *Client) InstallReleaseFromTarball(ctx context.Context, path, ns string, options ...helmclient.InstallOption) error
InstallReleaseFromTarball installs a chart packaged in the given tarball.
func (*Client) ListReleaseContents ¶
func (c *Client) ListReleaseContents(ctx context.Context) ([]*ReleaseContent, error)
ListReleaseContents gets the current status of all Helm Releases.
func (*Client) LoadChart ¶
LoadChart loads a Helm Chart and returns relevant parts of its structure.
func (*Client) PingTiller ¶
PingTiller proxies the underlying Helm client PingTiller method.
func (*Client) PullChartTarball ¶
PullChartTarball downloads a tarball from the provided tarball URL, returning the file path.
func (*Client) RunReleaseTest ¶
func (c *Client) RunReleaseTest(ctx context.Context, releaseName string, options ...helmclient.ReleaseTestOption) error
RunReleaseTest runs the tests for a Helm Release. The releaseName is the name of the Helm Release that is set when the Helm Chart is installed. This is the same action as running the helm test command.
func (*Client) UpdateReleaseFromTarball ¶
func (c *Client) UpdateReleaseFromTarball(ctx context.Context, releaseName, path string, options ...helmclient.UpdateOption) error
UpdateReleaseFromTarball updates the given release using the chart packaged in the tarball.
type Config ¶
type Config struct {
Fs afero.Fs
// HelmClient sets a helm client used for all operations of the initiated
// client. If this is nil, a new helm client will be created for each
// operation via proper port forwarding. Setting the helm client here manually
// might only be sufficient for testing or whenever you know what you do.
HelmClient helmclient.Interface
K8sClient kubernetes.Interface
Logger micrologger.Logger
EnsureTillerInstalledMaxWait time.Duration
RestConfig *rest.Config
TillerImageName string
TillerImageRegistry string
TillerNamespace string
TillerUpgradeEnabled bool
}
Config represents the configuration used to create a helm client.
type Interface ¶
type Interface interface {
// DeleteRelease uninstalls a chart given its release name.
DeleteRelease(ctx context.Context, releaseName string, options ...helm.DeleteOption) error
// EnsureTillerInstalled installs Tiller by creating its deployment and waiting
// for it to start. A service account and cluster role binding are also created.
// As a first step, it checks if Tiller is already ready, in which case it
// returns early.
EnsureTillerInstalled(ctx context.Context) error
// EnsureTillerInstalledWithValues installs Tiller by creating its deployment
// and waiting for it to start. A service account and cluster role binding are
// also created. Values can be provided to pass through to Tiller
// and overwrite its deployment defaults.
EnsureTillerInstalledWithValues(ctx context.Context, values []string) error
// GetReleaseContent gets the current status of the Helm Release. The
// releaseName is the name of the Helm Release that is set when the Chart
// is installed.
GetReleaseContent(ctx context.Context, releaseName string) (*ReleaseContent, error)
// GetReleaseHistory gets the current installed version of the Helm Release.
// The releaseName is the name of the Helm Release that is set when the Helm
// Chart is installed.
GetReleaseHistory(ctx context.Context, releaseName string) (*ReleaseHistory, error)
// InstallReleaseFromTarball installs a Helm Chart packaged in the given tarball.
InstallReleaseFromTarball(ctx context.Context, path, ns string, options ...helm.InstallOption) error
// ListReleaseContents gets the current status of all Helm Releases.
ListReleaseContents(ctx context.Context) ([]*ReleaseContent, error)
// LoadChart loads a Helm Chart and returns its structure.
LoadChart(ctx context.Context, chartPath string) (Chart, error)
// PingTiller proxies the underlying Helm client PingTiller method.
PingTiller(ctx context.Context) error
// PullChartTarball downloads a tarball from the provided tarball URL,
// returning the file path.
PullChartTarball(ctx context.Context, tarballURL string) (string, error)
// RunReleaseTest runs the tests for a Helm Release. This is the same
// action as running the helm test command.
RunReleaseTest(ctx context.Context, releaseName string, options ...helm.ReleaseTestOption) error
// UpdateReleaseFromTarball updates the given release using the chart packaged
// in the tarball.
UpdateReleaseFromTarball(ctx context.Context, releaseName, path string, options ...helm.UpdateOption) error
}
Interface describes the methods provided by the helm client.
type ReleaseContent ¶
type ReleaseContent struct {
// Name is the name of the Helm Release.
Name string
// Status is the Helm status code of the Release.
Status string
// Values are the values provided when installing the Helm Release.
Values map[string]interface{}
}
ReleaseContent returns status information about a Helm Release.
type ReleaseHistory ¶
type ReleaseHistory struct {
// AppVersion is the app version of the Helm Chart that has been deployed.
AppVersion string
// Description is a human-friendly "log entry" about this Helm release.
Description string
// LastDeployed is the time the Helm Chart was last deployed.
LastDeployed time.Time
// Name is the name of the Helm Release.
Name string
// Version is the version of the Helm Chart that has been deployed.
Version string
}
ReleaseHistory returns version information about a Helm Release.