Documentation ¶
Overview ¶
Package helm provides utility to leverage helm in tests without requiring the CLI.
Index ¶
- type Chart
- type Client
- func (c *Client) AddRepository(cfg *RepositoryEntry) error
- func (c *Client) Close() error
- func (c *Client) Install(chartName, version string, valuesOptions ValuesOptions, opts ...InstallOption) (*Release, error)
- func (c *Client) List() ([]*release.Release, error)
- func (c *Client) Uninstall(releaseName string) error
- type ClientOption
- type DebugLog
- type InstallOption
- type Release
- type RepositoryEntry
- type ValuesOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Chart ¶
Chart is a helm package that contains metadata, a default config, zero or more optionally parameterizable templates, and zero or more charts (dependencies).
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client represents the temporary helm environment.
func NewClient ¶
func NewClient(kubeConfig string, opts ...ClientOption) (*Client, error)
NewClient will create a new helm client providing an isolated helm environment. Only a valid kubeconfig is required. Make sure to properly clean up temporary files by calling Close once finished.
func (*Client) AddRepository ¶
func (c *Client) AddRepository(cfg *RepositoryEntry) error
AddRepository will append the RepositoryEntry to the temporary repositories-file. It will also block until the index-file was downloaded.
func (*Client) Close ¶
Close will release all filesystem resources of the helm client instance. Make sure to always call this function if the helm client is not required anymore.
func (*Client) Install ¶
func (c *Client) Install(chartName, version string, valuesOptions ValuesOptions, opts ...InstallOption) (*Release, error)
Install will try to locate the chart and download the specified version. If the chartName is a local path, it will try to load the local chart instead. With the chart locally available it will install it using the provided values and options.
type ClientOption ¶
type ClientOption interface {
// contains filtered or unexported methods
}
ClientOption interface is implemented by all possible options to instantiate a new helm client.
func ClientWithDebugLog ¶
func ClientWithDebugLog(debugLog DebugLog) ClientOption
ClientWithDebugLog will use the provided function to output debug logs of helm.
func ClientWithDriver ¶
func ClientWithDriver(driver string) ClientOption
ClientWithDriver will change the helm storage driver. By default it will be 'secret', but 'configmap' and 'memory' are other sensible values.
func ClientWithNamespace ¶
func ClientWithNamespace(namespace string) ClientOption
ClientWithNamespace will adapt the default namespace used as a fallback by the helm client.
type DebugLog ¶
DebugLog is the function declaration required to capture log output from the Client.
type InstallOption ¶
type InstallOption interface {
// contains filtered or unexported methods
}
ClientOption interface is implemented by all possible options to install charts.
func InstallWithReleaseName ¶
func InstallWithReleaseName(name string) InstallOption
InstallWithReleaseName will override the release name, which will be a random string by default.
type Release ¶
Release describes a deployment of a chart, together with the chart and the variables used to deploy that chart.
type RepositoryEntry ¶
RepositoryEntry represents the collection of parameters to define a new entry of a helm repository.
type ValuesOptions ¶
ValuesOptions provides several options to provide values configuration for helm. All contained values can then be conveniently merged.