hooks

package
v1.4.6 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package hooks has helper functions for Runtime Hooks.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsOkToDelete

func IsOkToDelete(obj client.Object) bool

IsOkToDelete returns true if object has the OkToDeleteAnnotation in the annotations of the object, false otherwise.

func IsPending

func IsPending(hook runtimecatalog.Hook, obj client.Object) bool

IsPending returns true if there is an intent to call a hook being tracked in the object's PendingHooksAnnotation.

func MarkAsDone

func MarkAsDone(ctx context.Context, c client.Client, obj client.Object, hooks ...runtimecatalog.Hook) error

MarkAsDone removes the intent to call a Hook from the object's PendingHooksAnnotation. Usually this func is called after all the registered extensions for the Hook returned an answer without requests to hold on to the object's lifecycle (retryAfterSeconds).

func MarkAsOkToDelete

func MarkAsOkToDelete(ctx context.Context, c client.Client, obj client.Object) error

MarkAsOkToDelete adds the OkToDeleteAnnotation annotation to the object and patches it.

func MarkAsPending

func MarkAsPending(ctx context.Context, c client.Client, obj client.Object, hooks ...runtimecatalog.Hook) error

MarkAsPending adds to the object's PendingHooksAnnotation the intent to execute a hook after an operation completes. Usually this function is called when an operation is starting in order to track the intent to call an After<operation> hook later in the process.

Types

This section is empty.

Jump to

Keyboard shortcuts

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