Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ProcessFinalizers ¶
func ProcessFinalizers(ctx context.Context, client client.Client, reader client.Reader, recorder record.EventRecorder, obj runtime.Object, finalizers []Finalizer) (reconcile.Result, error)
The function will process finalizers of the object.
If the deletion timestamp is nil, then it will add all names of all missing finalizers, and update the object if this caused a change.
If the deletion timestamp is non-nil, it will iterate over the finalizers, and call the destructor for the first finalizer it still finds in the list (in any order). If the deconstructor returns as "finished", then will remove the finalizer from the list, and request to be re-queued.
**Note:** When the function requests to be re-queue, the object's finalizer list was changed, and this change must be persisted by the caller!
Types ¶
type DeconstructorContext ¶
type Finalizer ¶
type Finalizer struct { // the name of the finalizer Name string // The deconstructor function, which will be called when the finalizer // is still present on the object, and the deletion timestamp is set. // When the deconstructor is finished, or had nothing to do, it must return // a nil error, and a result which does not request a requeue. // // If the error is non-nil, or a requeue was requested, the finalizer will // *not* be removed from the list. Deconstruct func(ctx DeconstructorContext) (reconcile.Result, error) }
Click to show internal directories.
Click to hide internal directories.