kwrelease

package
v0.7.4-0...-fb5339c Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2020 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ListActiveReleases

func ListActiveReleases() []*rspb.Release

ListActiveReleases lists releases which have not been superseded by an upgrade, rollback or other operation.

Types

type Action

type Action string

Action describes the action that was taken by Helm. For example, it could be an install or an uninstall (delete) action. There are typically two phases to each action, pre and post. This can best be demonstrated by using helm ... --wait. Helm will create a release to mark the start of the action (pre) and update it to mark the end of the action (post).

const (
	ActionPreInstall   Action = "PRE_INSTALL"
	ActionPreRollback  Action = "PRE_ROLLBACK"
	ActionPreUpgrade   Action = "PRE_UPGRADE"
	ActionPostInstall  Action = "POST_INSTALL"
	ActionPostUpgrade  Action = "POST_UPGRADE"
	ActionPostRollback Action = "POST_ROLLBACK"
	// Because string matching is a dangerous game, we should have a fallback for times we
	// can't tell if the operation was an Upgrade or a Rollback.
	ActionPostReplace           Action = "POST_REPLACE"
	ActionPostReplaceSuperseded Action = "POST_REPLACE-SUPERSEDED"
	ActionPreUninstall          Action = "PRE_UNINSTALL"
	ActionFailedInstall         Action = "FAILED_INSTALL"
	ActionFailedReplace         Action = "FAILED_REPLACE"
)

All possible actions and their states. See helm/pkg/release/status.go for more details.

func (Action) String

func (a Action) String() string

type Event

type Event struct {
	// Describes the action that happened to the secret in order to trigger this event. Events
	// occur when secrets are created, updated or deleted. What was the action that led to this
	// particular event.
	SecretAction         string
	CurrentReleaseSecret *api_v1.Secret
	// contains filtered or unexported fields
}

Event marks a release event. Upgrading a Helm chart from one version to another is an example of an event. Installing a chart is a different type of event.

func (*Event) GetAction

func (e *Event) GetAction() Action

GetAction returns the action which is being performed in this Event. It may be an install, upgrade or other Event.

func (*Event) GetAppDescription

func (e *Event) GetAppDescription() string

GetAppDescription returns the description of the application being installed or upgraded.

func (*Event) GetAppName

func (e *Event) GetAppName() string

GetAppName returns the name of the application being installed by the Helm chart.

func (*Event) GetAppVersion

func (e *Event) GetAppVersion() string

GetAppVersion returns the version of the application being installed by the Helm chart.

func (*Event) GetChartVersion

func (e *Event) GetChartVersion() string

GetChartVersion returns the version of the Helm chart being installed. This is different than the version of the application being installed. The same application version may span multiple chart versions.

func (*Event) GetConfigDiffYAML

func (e *Event) GetConfigDiffYAML() string

GetConfigDiffYAML is useful to show what has changed during a chart upgrade or rollback. It will show a diff of the values file in the Slack message or other notification. Be careful with secrets.

func (*Event) GetLabelsModifiedAtTimestamp

func (e *Event) GetLabelsModifiedAtTimestamp() meta_v1.Time

GetLabelsModifiedAtTimestamp returns the modifiedAt time in the release Meta. It's stored in the release as an Int and thus must be converted to a meta_v1.Time so it can be more easily compared with the creation timestamp.

func (*Event) GetNamespace

func (e *Event) GetNamespace() string

GetNamespace returns the namespace that the event is occurring in.

func (*Event) GetNotes

func (e *Event) GetNotes() string

GetNotes returns the install notes of the Helm package being installed or upgraded.

func (*Event) GetPreviousAppVersion

func (e *Event) GetPreviousAppVersion() string

GetPreviousAppVersion returns the version of the application being superseeded by the current upgrade event. It can be used to send notifications like "upgrading X from version 1 to version 2"

func (*Event) GetPreviousChartVersion

func (e *Event) GetPreviousChartVersion() string

GetPreviousChartVersion returns the version of the previously installed Helm chart. This is useful during an upgrade when we wish to see how significant the upgrade is.

func (*Event) GetRelease

func (e *Event) GetRelease(secretName string) *rspb.Release

GetRelease retrieves a release object from the Kubernetes Secret store. It delegates to the Helm Driver for this operation in order to reduce the possibility of breaking changes.

func (*Event) GetReleaseDescription

func (e *Event) GetReleaseDescription() string

GetReleaseDescription returns the Description of the release. This is primarily useful because it contains information about the cause of failure when a failure occurs.

func (*Event) GetSecretCreationTimestamp

func (e *Event) GetSecretCreationTimestamp() meta_v1.Time

GetSecretCreationTimestamp returns the time that the release secret was created by Helm. Note that it returns a custom Time object which is defined in the Kubernetes meta_v1 API. It's not an instance of the standard go Time struct.

func (*Event) GetSecretUID

func (e *Event) GetSecretUID() kbtypes.UID

GetSecretUID returns the UID of the release secret. Note that it returns a custom struct which is defined in the Kubernetes library. It's not a string or suchlike.

func (*Event) Init

func (e *Event) Init() error

Init pre-loads data for the event.

  • Brand new installs will only have e.currentRelease.
  • Upgrades, rollbacks and uninstalls will have e.currentRelease and e.previousRelease (unless they have been deleted by the user or something)

func (*Event) IsAppVersionChanged

func (e *Event) IsAppVersionChanged() bool

IsAppVersionChanged makes it easy to tell if the application is upgraded when upgrading from one Helm Chart version to another.

Jump to

Keyboard shortcuts

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