...

Package finalizer

import "sigs.k8s.io/controller-runtime/pkg/finalizer"
Overview
Index

Overview ▾

type Finalizer

Finalizer holds Finalize that will add/remove a finalizer based on the deletion timestamp being set and return an indication of whether the obj needs an update or not.

type Finalizer interface {
    Finalize(context.Context, client.Object) (Result, error)
}

type Finalizers

Finalizers implements Registerer and Finalizer to finalize all registered finalizers if the provided object has a deletion timestamp or set all registered finalizers if it does not.

type Finalizers interface {
    Registerer
    Finalizer
}

func NewFinalizers

func NewFinalizers() Finalizers

NewFinalizers returns the Finalizers interface.

type Registerer

Registerer holds Register that will check if a key is already registered and error out and it does; and if not registered, it will add the finalizer to the finalizers map as the value for the provided key.

type Registerer interface {
    Register(key string, f Finalizer) error
}

type Result

Result struct holds information about what parts of an object were updated by finalizer(s).

type Result struct {
    // Updated will be true if at least one of the object's non-status field
    // was updated by some registered finalizer.
    Updated bool
    // StatusUpdated will be true if at least one of the object's status' fields
    // was updated by some registered finalizer.
    StatusUpdated bool
}