Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddOwnerLabels ¶
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.