release

package
v1.0.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2019 License: Apache-2.0 Imports: 30 Imported by: 2

Documentation

Index

Constants

View Source
const (
	LabelAction      = "action"
	LabelDryRun      = "dry_run"
	LabelSuccess     = "success"
	LabelNamespace   = "namespace"
	LabelReleaseName = "release_name"
)

Variables

This section is empty.

Functions

func ObserveRelease

func ObserveRelease(start time.Time, action Action, dryRun, success bool, namespace, releaseName string)

func Values

func Values(corev1 k8sclientv1.CoreV1Interface, ns string, chartPath string, valuesFromSource []helmfluxv1.ValuesFromSource, values chartutil.Values) (chartutil.Values, error)

Values tries to resolve all given value file sources and merges them into one Values struct. It returns the merged Values.

func ValuesChecksum

func ValuesChecksum(rawValues []byte) string

ValuesChecksum calculates the SHA256 checksum of the given raw values.

Types

type Action

type Action string
const (
	InstallAction Action = "CREATE"
	UpgradeAction Action = "UPDATE"
)

type DeployInfo

type DeployInfo struct {
	Name string
}

type InstallOptions

type InstallOptions struct {
	DryRun    bool
	ReuseName bool
}

type Release

type Release struct {
	HelmClient *k8shelm.Client
	// contains filtered or unexported fields
}

Release contains clients needed to provide functionality related to helm releases

func New

func New(logger log.Logger, helmClient *k8shelm.Client) *Release

New creates a new Release instance.

func (*Release) Delete

func (r *Release) Delete(name string) error

Delete purges a Chart release

func (*Release) GetUpgradableRelease

func (r *Release) GetUpgradableRelease(name string) (*hapi_release.Release, error)

GetUpgradableRelease returns a release if the current state of it allows an upgrade, a descriptive error if it is not allowed, or nil if the release does not exist.

func (*Release) Install

func (r *Release) Install(chartPath, releaseName string, hr helmfluxv1.HelmRelease, action Action, opts InstallOptions,
	kubeClient *kubernetes.Clientset) (release *hapi_release.Release, checksum string, err error)

Install performs a Chart release given the directory containing the charts, and the HelmRelease specifying the release. Depending on the release type, this is either a new release, or an upgrade of an existing one.

TODO(michael): cloneDir is only relevant if installing from git; either split this procedure into two varieties, or make it more general and calculate the path to the chart in the caller.

func (*Release) OwnedByHelmRelease

func (r *Release) OwnedByHelmRelease(release *hapi_release.Release, hr helmfluxv1.HelmRelease) bool

OwnedByHelmRelease validates the release is managed by the given HelmRelease, by looking for the resource ID in the antecedent annotation. This validation is necessary because we can not validate the uniqueness of a release name on the creation of a HelmRelease, which would result in the operator attempting to upgrade a release indefinitely when multiple HelmReleases with the same release name exist.

To be able to migrate existing releases to a HelmRelease, empty (missing) annotations are handled as true / owned by.

func (*Release) Rollback

func (r *Release) Rollback(releaseName string, hr helmfluxv1.HelmRelease) (*hapi_release.Release, error)

Rollback rolls back a Chart release if required

type Releaser

type Releaser interface {
	GetUpgradableRelease(name string) (*hapi_release.Release, error)
	Install(dir string, releaseName string, hr helmfluxv1.HelmRelease, action Action, opts InstallOptions) (*hapi_release.Release, error)
}

Jump to

Keyboard shortcuts

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