deletionhelper

package
v0.0.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 29, 2019 License: Apache-2.0 Imports: 8 Imported by: 0

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

func (dh *DeletionHelper) EnsureFinalizer(obj runtime.Object) (runtime.Object, error)

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

type ObjNameFunc func(runtime.Object) string

type UpdateObjFunc

type UpdateObjFunc func(runtime.Object) (runtime.Object, error)

Jump to

Keyboard shortcuts

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