finalizers

package
v2.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

README

Death Controller

Death controller controls the .ObjectMeta.Finalizers field:

  1. If the object don't have a finalizer, add one for it.
  2. If the finalizer has been updated, upload them to kubernetes server.
  3. If the object has been deleted, and it includes clenFinalizerForced annotation, removes the finalizer, or iterates over the records, and if all of them are "not injected", remove the finalizer.

Documentation

Index

Constants

View Source
const (
	// AnnotationCleanFinalizer key
	AnnotationCleanFinalizer = `chaos-mesh.chaos-mesh.org/cleanFinalizer`
	// AnnotationCleanFinalizerForced value
	AnnotationCleanFinalizerForced = `forced`

	RecordFinalizer = "chaos-mesh/records"
)

Variables

This section is empty.

Functions

func ContainsFinalizer

func ContainsFinalizer(o metav1.Object, finalizer string) bool

ContainsFinalizer checks an Object that the provided finalizer is present.

Types

type CleanReconciler

type CleanReconciler struct {
	ReconcilerMeta
}

CleanReconciler for common chaos to clean the finalizer

func (*CleanReconciler) Reconcile

func (r *CleanReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

Reconcile the common chaos to clean the finalizer

type InitReconciler

type InitReconciler struct {
	ReconcilerMeta
}

InitReconciler for common chaos to init the finalizer

func (*InitReconciler) Reconcile

func (r *InitReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

Reconcile the common chaos to init the finalizer

type ReconcilerMeta

type ReconcilerMeta struct {
	// Object is used to mark the target type of this Reconciler
	Object v1alpha1.InnerObject

	// Client is used to operate on the Kubernetes cluster
	client.Client

	Recorder recorder.ChaosRecorder

	Log logr.Logger
}

ReconcilerMeta defines the meta of InitReconciler and CleanReconciler struct.

Jump to

Keyboard shortcuts

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