Documentation ¶
Overview ¶
Package to help federation controllers to delete federated resources from underlying clusters when the resource is deleted from federation control plane.
Index ¶
Constants ¶
const ( // Add this finalizer to a federation resource if the resource should be // deleted from all underlying clusters before being deleted from // federation control plane. // This is ignored if FinalizerOrphan is also present on the resource. // In that case, both finalizers are removed from the resource and the // resource is deleted from federation control plane without affecting // the underlying clusters. FinalizerDeleteFromUnderlyingClusters string = "federation.kubernetes.io/delete-from-underlying-clusters" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DeletionHelper ¶
type DeletionHelper struct {
// contains filtered or unexported fields
}
func NewDeletionHelper ¶
func NewDeletionHelper( hasFinalizerFunc HasFinalizerFunc, removeFinalizerFunc RemoveFinalizerFunc, addFinalizerFunc AddFinalizerFunc, objNameFunc ObjNameFunc, updateTimeout time.Duration, eventRecorder record.EventRecorder, informer util.FederatedInformer, updater util.FederatedUpdater) *DeletionHelper
func (*DeletionHelper) EnsureDeleteFromUnderlyingClustersFinalizer ¶
func (dh *DeletionHelper) EnsureDeleteFromUnderlyingClustersFinalizer(obj runtime.Object) ( runtime.Object, error)
Ensures that the given object has the required finalizer to ensure that objects are deleted in underlying clusters when this object is deleted from federation control plane. This method should be called before creating objects in underlying clusters.
func (*DeletionHelper) HandleObjectInUnderlyingClusters ¶
func (dh *DeletionHelper) HandleObjectInUnderlyingClusters(obj runtime.Object) ( runtime.Object, error)
Deletes the resources corresponding to the given federated resource from all underlying clusters, unless it has the FinalizerOrphan finalizer. Removes FinalizerOrphan and FinalizerDeleteFromUnderlyingClusters finalizers when done. Callers are expected to keep calling this (with appropriate backoff) until it succeeds.