meta

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2019 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// AnnotationHookType contains the type of the hook. If this annotation is
	// set on a Job it will be treated as a hook and not show up as regular
	// resource anymore.
	AnnotationHookType = "kubectl-chart/hook-type"

	// AnnotationHookAllowFailure controls the behaviour in the event where the
	// hook fails due to timeouts or because the job failed. If set to "true",
	// these errors just will be logged and processing of other hooks and
	// resources continues. Other unhandled errors occuring during hook
	// execution (e.g. API-Server errors) will still bubble up the error
	// handling chain.
	AnnotationHookAllowFailure = "kubectl-chart/hook-allow-failure"

	// AnnotationHookNoWait controls the waiting behaviour. If set to "true",
	// it is not waited for the hook to complete. This cannot be used together
	// with AnnotationHookAllowFailure because the success of a hook is not
	// checked if we do not wait for it to finish.
	AnnotationHookNoWait = "kubectl-chart/hook-no-wait"

	// AnnotationHookWaitTimeout sets a custom wait timeout for a hook. If not
	// set, wait.DefaultWaitTimeout is used.
	AnnotationHookWaitTimeout = "kubectl-chart/hook-wait-timeout"

	// AnnotationDeletionPolicy can be set on resources to specify non-default
	// deletion behaviour. Currently this annotation is ignored on all
	// resources except for StatefulSets.
	AnnotationDeletionPolicy = "kubectl-chart/deletion-policy"
)
View Source
const (
	// LabelChartName is used to attach a label to each resource in a rendered chart
	// to be able to keep track of them once they are deployed into a cluster.
	LabelChartName = "kubectl-chart/chart-name"

	// LabelHookChartName is used to attach a label to each hook to be able to
	// keep track of them once they are deployed into a cluster. The label is
	// different from LabelChartName because hooks have a different lifecycle
	// than normal resources.
	LabelHookChartName = "kubectl-chart/hook-chart-name"

	// LabelHookType is set on chart hooks to be able to clean them up by type.
	LabelHookType = "kubectl-chart/hook-type"

	// LabelOwnedByStatefulSet is set on PersistentVolumeClaims to identify
	// them when a StatefulSet is deleted.
	LabelOwnedByStatefulSet = "kubectl-chart/owned-by-statefulset"
)

Variables

This section is empty.

Functions

func AddLabel

func AddLabel(obj runtime.Object, key, value string) error

AddLabel adds a label on an object. If the label already exists it will be overwritten.

func DefaultNamespace

func DefaultNamespace(obj runtime.Object, namespace string) error

DefaultNamespace will set namespace on the resource if it does not have a namespace set. Will return an error if namespace is empty or accessing the objects metadata fails for some reason.

func HasAnnotation

func HasAnnotation(obj runtime.Object, key string, value ...string) bool

HasAnnotation returns true if an annotation key exists and has given value. If value is omitted, only the existence of the annotation key is checked.

func HasGroupKind

func HasGroupKind(obj runtime.Object, groupKind schema.GroupKind) bool

HasGroupKind returns true if obj has given groupKind.

Types

type DeletionPolicy

type DeletionPolicy string

DeletionPolicy controls behaviour on resource deletion.

const (
	// DeletionPolicyDeletePVCs can be specified in the
	// kubectl-chart/deletion-policy annotation on StatefulSets to make
	// kubectl-chart delete all PersistentVolumeClaims created from the
	// StatefulSet's VolumeClaimTemplates after the StatefulSet is deleted.
	DeletionPolicyDeletePVCs DeletionPolicy = "delete-pvcs"
)

func (DeletionPolicy) String

func (p DeletionPolicy) String() string

String implements fmt.Stringer.

Jump to

Keyboard shortcuts

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