kymahelm

package
v0.0.0-...-4cb8388 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2022 License: Apache-2.0 Imports: 15 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetProfileValues

func GetProfileValues(ch chart.Chart, profileName string) (map[string]interface{}, error)

GetProfileValues Return Map of chart values for profileName profile file

Types

type Client

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

Client is a Helm client

func NewClient

func NewClient(overridesLogger *logrus.Logger, maxHistory int, driver string, debug bool) *Client

NewClient initializes an instance of Client and returns it

func (*Client) InstallRelease

func (hc *Client) InstallRelease(chartDir string, nn NamespacedName, overrideValues overrides.Map, profile string) (*Release, error)

InstallRelease installs a Helm chart

func (*Client) IsReleaseDeletable

func (hc *Client) IsReleaseDeletable(nn NamespacedName) (bool, error)

IsReleaseDeletable returns true for release that can be deleted

func (*Client) IsReleasePresent

func (hc *Client) IsReleasePresent(nn NamespacedName) (bool, error)

IsReleasePresent returns true for release that cis present on the cluster

func (*Client) ListReleases

func (hc *Client) ListReleases() ([]*Release, error)

ListReleases lists all releases except for the superseded ones

func (*Client) PrintOverrides

func (hc *Client) PrintOverrides(values overrides.Map, relName string, action string)

PrintOverrides .

func (*Client) PrintRelease

func (hc *Client) PrintRelease(release *Release)

PrintRelease .

func (*Client) ReleaseDeployedRevision

func (hc *Client) ReleaseDeployedRevision(nn NamespacedName) (int, error)

ReleaseDeployedRevision returns the last deployed revision

func (*Client) ReleaseStatus

func (hc *Client) ReleaseStatus(nn NamespacedName) (*ReleaseStatus, error)

ReleaseStatus returns release status

func (*Client) RollbackRelease

func (hc *Client) RollbackRelease(nn NamespacedName, revision int) error

RollbackRelease performs rollback of a Helm release

func (*Client) UninstallRelease

func (hc *Client) UninstallRelease(nn NamespacedName) error

UninstallRelease uninstalls a Helm release

func (*Client) UpgradeRelease

func (hc *Client) UpgradeRelease(chartDir string, nn NamespacedName, overrideValues overrides.Map, profile string) (*Release, error)

UpgradeRelease upgrades a Helm chart

func (*Client) WaitForCondition

func (hc *Client) WaitForCondition(nn NamespacedName, pf WaitPredicateFunc, opts ...WaitOption) (bool, error)

WaitForCondition returns true if condition was fulfilled within configured time, returns false otherwise. Returns an error immediately if the configured predicate function returns an error.

func (*Client) WaitForReleaseDelete

func (hc *Client) WaitForReleaseDelete(nn NamespacedName) (bool, error)

func (*Client) WaitForReleaseRollback

func (hc *Client) WaitForReleaseRollback(nn NamespacedName) (bool, error)

type ClientInterface

type ClientInterface interface {
	ListReleases() ([]*Release, error)
	IsReleaseDeletable(nn NamespacedName) (bool, error)
	IsReleasePresent(nn NamespacedName) (bool, error)
	ReleaseDeployedRevision(nn NamespacedName) (int, error)
	InstallRelease(chartDir string, nn NamespacedName, overrides overrides.Map, profile string) (*Release, error)
	UpgradeRelease(chartDir string, nn NamespacedName, overrides overrides.Map, profile string) (*Release, error)
	UninstallRelease(nn NamespacedName) error
	RollbackRelease(nn NamespacedName, revision int) error
	WaitForReleaseDelete(nn NamespacedName) (bool, error)
	WaitForReleaseRollback(nn NamespacedName) (bool, error)
	PrintRelease(release *Release)
}

ClientInterface exposes functions to interact with Helm

type NamespacedName

type NamespacedName struct {
	Name      string
	Namespace string
}

NamespacedName Combines release name and namespace

type Release

type Release struct {
	*ReleaseMeta
	*ReleaseStatus
}

Release is an internal representation of a Helm release

type ReleaseMeta

type ReleaseMeta struct {
	NamespacedName
	Description string
}

ReleaseMeta is an internal representation of Helm's release metadata

type ReleaseStatus

type ReleaseStatus struct {
	Status               Status
	CurrentRevision      int
	LastDeployedRevision int
}

ReleaseStatus is an internal representation of Helm's release status

func (*ReleaseStatus) IsUpgradeStep

func (rs *ReleaseStatus) IsUpgradeStep() (bool, error)

type Status

type Status string
const (
	// StatusUnknown indicates that a release is in an uncertain state.
	StatusUnknown Status = "unknown"
	// StatusDeployed indicates that the release has been pushed to Kubernetes.
	StatusDeployed Status = "deployed"
	// StatusUninstalled indicates that a release has been uninstalled from Kubernetes.
	StatusUninstalled Status = "uninstalled"
	// StatusSuperseded indicates that this release object is outdated and a newer one exists.
	StatusSuperseded Status = "superseded"
	// StatusFailed indicates that the release was not successfully deployed.
	StatusFailed Status = "failed"
	// StatusUninstalling indicates that a uninstall operation is underway.
	StatusUninstalling Status = "uninstalling"
	// StatusPendingInstall indicates that an install operation is underway.
	StatusPendingInstall Status = "pending-install"
	// StatusPendingUpgrade indicates that an upgrade operation is underway.
	StatusPendingUpgrade Status = "pending-upgrade"
	// StatusPendingRollback indicates that an rollback operation is underway.
	StatusPendingRollback Status = "pending-rollback"
)

type UninstallReleaseStatus

type UninstallReleaseStatus struct {
}

UninstallReleaseResponse is an internal representation of Helm's uninstall release response

type WaitOption

type WaitOption func(*waitConditionCfg)

func MaxIterations

func MaxIterations(val uint8) WaitOption

func ReleaseStatusFunc

func ReleaseStatusFunc(val WaitReleaseStatusFunc) WaitOption

func SleepTimeSecs

func SleepTimeSecs(val uint8) WaitOption

type WaitPredicateFunc

type WaitPredicateFunc func(releaseStatus *ReleaseStatus, relStatusResponseErr error) (bool, error)

type WaitReleaseStatusFunc

type WaitReleaseStatusFunc func(nn NamespacedName) (*ReleaseStatus, error)

Jump to

Keyboard shortcuts

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