Admission Controller PVC Finalizer Plugin
This admission plugin puts finalizer to every created PVC. The finalizer is removed by PVCProtectionController when the PVC is not referenced by any pods and thus the PVC can be deleted.
This commit is contained in:
@@ -20,6 +20,11 @@ import (
|
||||
"k8s.io/api/core/v1"
|
||||
)
|
||||
|
||||
const (
|
||||
// Name of finalizer on PVCs that have a running pod.
|
||||
PVCProtectionFinalizer = "kubernetes.io/pvc-protection"
|
||||
)
|
||||
|
||||
// IsPVCBeingDeleted returns:
|
||||
// true: in case PVC is being deleted, i.e. ObjectMeta.DeletionTimestamp is set
|
||||
// false: in case PVC is not being deleted, i.e. ObjectMeta.DeletionTimestamp is nil
|
||||
|
Reference in New Issue
Block a user