release

package
v3.10.7 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const HookAnnotation = "helm.sh/hook"

HookAnnotation is the label name for a hook

View Source
const HookDeleteAnnotation = "helm.sh/hook-delete-policy"

HookDeleteAnnotation is the label name for the delete policy for a hook

View Source
const HookWeightAnnotation = "helm.sh/hook-weight"

HookWeightAnnotation is the label name for a hook weight

Variables

View Source
var MockHookTemplate = `apiVersion: v1
kind: Job
metadata:
  annotations:
    "github.com/ruijzhan/hook": pre-install
`

MockHookTemplate is the hook template used for all mock release objects.

View Source
var MockManifest = `apiVersion: v1
kind: Secret
metadata:
  name: fixture
`

MockManifest is the manifest used for all mock release objects.

Functions

This section is empty.

Types

type Hook

type Hook struct {
	Name string `json:"name,omitempty"`
	// Kind is the Kubernetes kind.
	Kind string `json:"kind,omitempty"`
	// Path is the chart-relative path to the template.
	Path string `json:"path,omitempty"`
	// Manifest is the manifest contents.
	Manifest string `json:"manifest,omitempty"`
	// Events are the events that this hook fires on.
	Events []HookEvent `json:"events,omitempty"`
	// LastRun indicates the date/time this was last run.
	LastRun HookExecution `json:"last_run,omitempty"`
	// Weight indicates the sort order for execution among similar Hook type
	Weight int `json:"weight,omitempty"`
	// DeletePolicies are the policies that indicate when to delete the hook
	DeletePolicies []HookDeletePolicy `json:"delete_policies,omitempty"`
}

Hook defines a hook object.

type HookDeletePolicy

type HookDeletePolicy string

HookDeletePolicy specifies the hook delete policy

const (
	HookSucceeded          HookDeletePolicy = "hook-succeeded"
	HookFailed             HookDeletePolicy = "hook-failed"
	HookBeforeHookCreation HookDeletePolicy = "before-hook-creation"
)

Hook delete policy types

func (HookDeletePolicy) String

func (x HookDeletePolicy) String() string

type HookEvent

type HookEvent string

HookEvent specifies the hook event

const (
	HookPreInstall   HookEvent = "pre-install"
	HookPostInstall  HookEvent = "post-install"
	HookPreDelete    HookEvent = "pre-delete"
	HookPostDelete   HookEvent = "post-delete"
	HookPreUpgrade   HookEvent = "pre-upgrade"
	HookPostUpgrade  HookEvent = "post-upgrade"
	HookPreRollback  HookEvent = "pre-rollback"
	HookPostRollback HookEvent = "post-rollback"
	HookTest         HookEvent = "test"
)

Hook event types

func (HookEvent) String

func (x HookEvent) String() string

type HookExecution

type HookExecution struct {
	// StartedAt indicates the date/time this hook was started
	StartedAt time.Time `json:"started_at,omitempty"`
	// CompletedAt indicates the date/time this hook was completed.
	CompletedAt time.Time `json:"completed_at,omitempty"`
	// Phase indicates whether the hook completed successfully
	Phase HookPhase `json:"phase"`
}

A HookExecution records the result for the last execution of a hook for a given release.

type HookPhase

type HookPhase string

A HookPhase indicates the state of a hook execution

const (
	// HookPhaseUnknown indicates that a hook is in an unknown state
	HookPhaseUnknown HookPhase = "Unknown"
	// HookPhaseRunning indicates that a hook is currently executing
	HookPhaseRunning HookPhase = "Running"
	// HookPhaseSucceeded indicates that hook execution succeeded
	HookPhaseSucceeded HookPhase = "Succeeded"
	// HookPhaseFailed indicates that hook execution failed
	HookPhaseFailed HookPhase = "Failed"
)

func (HookPhase) String

func (x HookPhase) String() string

String converts a hook phase to a printable string

type Info

type Info struct {
	// FirstDeployed is when the release was first deployed.
	FirstDeployed time.Time `json:"first_deployed,omitempty"`
	// LastDeployed is when the release was last deployed.
	LastDeployed time.Time `json:"last_deployed,omitempty"`
	// Deleted tracks when this object was deleted.
	Deleted time.Time `json:"deleted"`
	// Description is human-friendly "log entry" about this release.
	Description string `json:"description,omitempty"`
	// Status is the current state of the release
	Status Status `json:"status,omitempty"`
	// Contains the rendered templates/NOTES.txt if available
	Notes string `json:"notes,omitempty"`
}

Info describes release information.

type MockReleaseOptions

type MockReleaseOptions struct {
	Name      string
	Version   int
	Chart     *chart.Chart
	Status    Status
	Namespace string
}

MockReleaseOptions allows for user-configurable options on mock release objects.

type Release

type Release struct {
	// Name is the name of the release
	Name string `json:"name,omitempty"`
	// Info provides information about a release
	Info *Info `json:"info,omitempty"`
	// Chart is the chart that was released.
	Chart *chart.Chart `json:"chart,omitempty"`
	// Config is the set of extra Values added to the chart.
	// These values override the default values inside of the chart.
	Config map[string]interface{} `json:"config,omitempty"`
	// Manifest is the string representation of the rendered template.
	Manifest string `json:"manifest,omitempty"`
	// Hooks are all of the hooks declared for this release.
	Hooks []*Hook `json:"hooks,omitempty"`
	// Version is an int which represents the revision of the release.
	Version int `json:"version,omitempty"`
	// Namespace is the kubernetes namespace of the release.
	Namespace string `json:"namespace,omitempty"`
	// Labels of the release.
	// Disabled encoding into Json cause labels are stored in storage driver metadata field.
	Labels map[string]string `json:"-"`
}

Release describes a deployment of a chart, together with the chart and the variables used to deploy that chart.

func Mock

func Mock(opts *MockReleaseOptions) *Release

Mock creates a mock release object based on options set by MockReleaseOptions. This function should typically not be used outside of testing.

func (*Release) SetStatus

func (r *Release) SetStatus(status Status, msg string)

SetStatus is a helper for setting the status on a release.

type Status

type Status string

Status is the status of a release

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"
)

Describe the status of a release NOTE: Make sure to update cmd/helm/status.go when adding or modifying any of these statuses.

func (Status) IsPending

func (x Status) IsPending() bool

IsPending determines if this status is a state or a transition.

func (Status) String

func (x Status) String() string

type UninstallReleaseResponse

type UninstallReleaseResponse struct {
	// Release is the release that was marked deleted.
	Release *Release `json:"release,omitempty"`
	// Info is an uninstall message
	Info string `json:"info,omitempty"`
}

UninstallReleaseResponse represents a successful response to an uninstall request.

Jump to

Keyboard shortcuts

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