deletionhelper

package
v1.5.0-alpha.2 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2016 License: Apache-2.0 Imports: 9 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 (
	// 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 AddFinalizerFunc

type AddFinalizerFunc func(runtime.Object, string) (runtime.Object, error)

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.

type HasFinalizerFunc

type HasFinalizerFunc func(runtime.Object, string) bool

type ObjNameFunc

type ObjNameFunc func(runtime.Object) string

type RemoveFinalizerFunc

type RemoveFinalizerFunc func(runtime.Object, string) (runtime.Object, error)

Jump to

Keyboard shortcuts

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