helmrelease

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: May 20, 2020 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsInvalidConfig

func IsInvalidConfig(err error) bool

IsInvalidConfig asserts invalidConfigError.

func IsNotFound

func IsNotFound(err error) bool

IsNotFound asserts notFoundError.

func IsReleaseAlreadyExists

func IsReleaseAlreadyExists(err error) bool

IsReleaseAlreadyExists asserts releaseAlreadyExistsError.

func IsReleaseNotFound

func IsReleaseNotFound(err error) bool

IsReleaseNotFound asserts releaseNotFoundError.

func IsReleaseStatusNotMatching

func IsReleaseStatusNotMatching(err error) bool

IsReleaseStatusNotMatching asserts releaseStatusNotMatchingError

func IsReleaseVersionNotMatching

func IsReleaseVersionNotMatching(err error) bool

IsReleaseVersionNotMatching asserts releaseVersionNotMatchingError

func IsTarballNotFound

func IsTarballNotFound(err error) bool

IsTarballNotFound asserts tarballNotFoundError.

func IsTillerNotFound

func IsTillerNotFound(err error) bool

IsTillerNotFound asserts tillerNotFoundError.

func IsWait

func IsWait(err error) bool

IsWait asserts waitError.

Types

type ChartInfo

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

func NewChartInfo

func NewChartInfo(name string, gitSHA string) ChartInfo

func NewStableChartInfo

func NewStableChartInfo(name string) ChartInfo

type ConditionFunc

type ConditionFunc func() error

type ConditionSet

type ConditionSet interface {
	// CRDExists returns a function waiting for the CRD to appear in the
	// Kubernetes API described by the given definition.
	CRDExists(ctx context.Context, crd *apiextensionsv1beta1.CustomResourceDefinition) ConditionFunc
	// CRDNotFound returns a function waiting for the CRD to disappear in
	// the Kubernetes API described by the given definition.
	CRDNotFound(ctx context.Context, crd *apiextensionsv1beta1.CustomResourceDefinition) ConditionFunc
	// PodExists returns a function waiting for a Pod to appear in the
	// Kubernetes API described by the given label selector.
	PodExists(ctx context.Context, namespace, labelSelector string) ConditionFunc
	// PodNotFound returns a function waiting for a Pod to disappear in the
	// Kubernetes API described by the given label selector.
	PodNotFound(ctx context.Context, namespace, labelSelector string) ConditionFunc
	// SecretExists returns a function waiting for the Secret to appear in the
	// Kubernetes API described by the given name.
	SecretExists(ctx context.Context, namespace, name string) ConditionFunc
	// SecretNotFound returns a function waiting for the Secret to
	// disappear in the Kubernetes API described by the given name.
	SecretNotFound(ctx context.Context, namespace, name string) ConditionFunc
}

type Config

type Config struct {
	ApprClient *apprclient.Client
	HelmClient *helmclient.Client
	Logger     micrologger.Logger
	K8sClient  *k8sclient.Clients

	Namespace string
}

type Release

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

func New

func New(config Config) (*Release, error)

func (*Release) Condition

func (r *Release) Condition() ConditionSet

func (*Release) Delete

func (r *Release) Delete(ctx context.Context, name string) error

func (*Release) EnsureDeleted

func (r *Release) EnsureDeleted(ctx context.Context, name string, conditions ...ConditionFunc) error

EnsureDeleted makes sure the release is deleted and purged and all conditions are met.

func (*Release) EnsureInstalled

func (r *Release) EnsureInstalled(ctx context.Context, name string, chartInfo ChartInfo, values string, conditions ...ConditionFunc) error

EnsureInstalled makes sure the release is installed and all conditions are met. If release name ends with "-operator" suffix it also selects a "app=${name}" pod and streams it logs to the ./logs directory.

NOTE: It does not update the release if it already exists.

func (*Release) Install

func (r *Release) Install(ctx context.Context, name string, chartInfo ChartInfo, values string, conditions ...ConditionFunc) error

func (*Release) Update

func (r *Release) Update(ctx context.Context, name string, chartInfo ChartInfo, values string, conditions ...ConditionFunc) error

func (*Release) WaitForChartInfo

func (r *Release) WaitForChartInfo(ctx context.Context, release string, version string) error

func (*Release) WaitForStatus

func (r *Release) WaitForStatus(ctx context.Context, release string, status string) error

type Version

type Version = ChartInfo

Version is an **alias** for ChartInfo. See https://golang.org/doc/go1.9#language.

func NewStableVersion

func NewStableVersion() Version

NewStableVersion is a compatibility method used for transition period only. Use NewStableChartInfo instead. For the transition period both versions of the code will have the same semantics.

r.Install(ctx, "apiextensions-aws-config-e2e", NewStableChartInfo("apiextensions-aws-config-e2e-chart"), values)
r.Install(ctx, "apiextensions-aws-config-e2e", NewStableVersion(), values))

The new ChartInfo struct was introduced to solve the problem of installing multiple releases of the same chart. E.g.

r.Install(ctx, "release-1", NewStableChartInfo("apiextensions-aws-config-e2e-chart"), values)
r.Install(ctx, "release-2", NewStableChartInfo("apiextensions-aws-config-e2e-chart"), values)

func NewVersion

func NewVersion(gitSHA string) Version

NewVersion is a compatibility method used for transition period only. Use NewChartInfo instead. For the transition period both versions of the code will have the same semantics.

r.Install(ctx, "apiextensions-aws-config-e2e", NewChartInfo("apiextensions-aws-config-e2e-chart", "afae404f496389dd955e70dfc78e898aa6726265"), values)
r.Install(ctx, "apiextensions-aws-config-e2e", NewVersion("afae404f496389dd955e70dfc78e898aa6726265"), values))

The new ChartInfo struct was introduced to solve the problem of installing multiple releases of the same chart. E.g.

r.Install(ctx, "release-1", NewChartInfo("apiextensions-aws-config-e2e-chart", "afae404f496389dd955e70dfc78e898aa6726265"), values)
r.Install(ctx, "release-2", NewChartInfo("apiextensions-aws-config-e2e-chart", "afae404f496389dd955e70dfc78e898aa6726265"), values)

Jump to

Keyboard shortcuts

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