Documentation ¶
Overview ¶
Package hooks has helper functions for Runtime Hooks.
Index ¶
- func IsOkToDelete(obj client.Object) bool
- func IsPending(hook runtimecatalog.Hook, obj client.Object) bool
- func MarkAsDone(ctx context.Context, c client.Client, obj client.Object, ...) error
- func MarkAsOkToDelete(ctx context.Context, c client.Client, obj client.Object) error
- func MarkAsPending(ctx context.Context, c client.Client, obj client.Object, ...) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsOkToDelete ¶
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 ¶
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.