statefulset

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: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddOwnerLabels

func AddOwnerLabels(obj runtime.Object) error

AddOwnerLabels adds the kubectl-chart/owned-by-statefulset label in the following locations:

  • spec.selector.matchLabels
  • spec.template.metadata.labels
  • spec.volumeClaimTemplates.metadata.labels

Kubernetes versions before 1.15 use the the matchLabels to set PVCs labels, while as of 1.15 labels from the volumeClaimTemplate's metadata are also supported (and take precedence). So we just set them all to be sure that we have a way to identify PVCs created from the volumeClaimTemplates later.

Types

type PersistentVolumeClaimPruner

type PersistentVolumeClaimPruner struct {
	Deleter       deletions.Deleter
	DynamicClient dynamic.Interface
	Mapper        kmeta.RESTMapper
}

PersistentVolumeClaimPruner prunes PersistentVolumeClaims of deleted StatefulSets.

func NewPersistentVolumeClaimPruner

func NewPersistentVolumeClaimPruner(client dynamic.Interface, deleter deletions.Deleter, mapper kmeta.RESTMapper) *PersistentVolumeClaimPruner

NewPersistentVolumeClaimPruner creates a new PersistentVolumeClaimPruner value.

func (*PersistentVolumeClaimPruner) PruneClaims

func (p *PersistentVolumeClaimPruner) PruneClaims(objs []runtime.Object) error

PruneClaims searches the slice of runtime objects for StatefulSets that have a deletion policy that requests the deletion of all PersistentVolumeClaims associated with the StatefulSet once it is deleted and prunes them. It is required that the object slice only contains objects of type *unstructured.Unstructured.

Jump to

Keyboard shortcuts

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