Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ReleaseAlreadyInstalledErr = func(name, namespace string) error { return eris.Errorf("The helm release you are trying to install (%s) appears"+ " to already exist in %s", name, namespace) } )
Functions ¶
func NewNamespaceClient ¶
func NewNamespaceClient(client v1.NamespaceInterface) *namespaceClient
Types ¶
type HelmClient ¶
type HelmClient interface {
// Prepare an installation object that can then be .Run() with a chart object
NewInstall(kubeConfig, kubeContext, namespace, releaseName string, dryRun bool) (internal.HelmInstaller, *cli.EnvSettings, error)
// Prepare an un-installation object that can then be .Run() with a release name
NewUninstall(kubeConfig, kubeContext, namespace string) (internal.HelmUninstaller, error)
// List the already-existing releases in the given namespace
ReleaseList(kubeConfig, kubeContext, namespace string) (internal.ReleaseListRunner, error)
// Returns the Helm chart archive located at the given URI (can be either an http(s) address or a file path)
DownloadChart(chartArchiveUri string) (*chart.Chart, error)
// Returns true if the release with the given name exists in the given namespace
ReleaseExists(kubeConfig, kubeContext, namespace, releaseName string) (releaseExists bool, err error)
}
This interface implements the Helm CLI actions. The implementation relies on the Helm 3 libraries.
func DefaultHelmClient ¶
func DefaultHelmClient() HelmClient
a HelmClient that talks to the kube api server and creates resources
type Installer ¶
type Installer interface {
Install(installerConfig *InstallerConfig) error
}
func MustInstaller ¶
func MustInstaller() Installer
func NewInstaller ¶
func NewInstaller(helmClient HelmClient, kubeNsClient NamespaceClient, outputWriter io.Writer) Installer
visible for testing
type InstallerConfig ¶
type InstallerConfig struct {
// kube config containing the context of cluster to install on
KubeConfig string
// kube context of cluster to install on
KubeContext string
DryRun bool
CreateNamespace bool
Verbose bool
InstallNamespace string
ReleaseName string
// the uri to the helm chart, can either be a local file or a valid http/https link
ReleaseUri string
ValuesFiles []string
ExtraValues map[string]interface{}
PreInstallMessage string
PostInstallMessage string
}
type NamespaceClient ¶ added in v0.15.0
type NamespaceClient interface {
Create(ns *corev1.Namespace) (*corev1.Namespace, error)
Delete(name string, options *metav1.DeleteOptions) error
Get(name string, options metav1.GetOptions) (*corev1.Namespace, error)
List(opts metav1.ListOptions) (*corev1.NamespaceList, error)
}
Click to show internal directories.
Click to hide internal directories.