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 ¶
View Source
const ( // If this finalizer is present on a federated resource, the sync // controller will have the opportunity to perform pre-deletion operations // (like deleting managed resources from member clusters). FinalizerSyncController = "federation.k8s.io/sync-controller" // If this annotation is present on a federated resource, resources in the // member clusters managed by the federated resource should be orphaned. // If the annotation is not present (the default), resources in member // clusters will be deleted before the federated resource is deleted. OrphanManagedResources = "federation.k8s.io/orphan" )
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( updateObjFunc UpdateObjFunc, objNameFunc ObjNameFunc, informer util.FederatedInformer, updater util.FederatedUpdater) *DeletionHelper
func (*DeletionHelper) EnsureFinalizer ¶ added in v0.0.8
Ensures that the given object has the FinalizerSyncController finalizer. The finalizer ensures that the controller is always notified when a federated resource is deleted so that host and member cluster cleanup can be performed.
func (*DeletionHelper) HandleObjectInUnderlyingClusters ¶
func (dh *DeletionHelper) HandleObjectInUnderlyingClusters(obj runtime.Object, targetKey string, skipDelete func(runtime.Object) bool) ( runtime.Object, error)
Deletes the resources in member clusters managed by the given federated resource unless the OrphanManagedResources annotation is present and has a value of 'true'. Callers are expected to keep calling this (with appropriate backoff) until it succeeds.
type ObjNameFunc ¶
Click to show internal directories.
Click to hide internal directories.