utils

package
v0.0.0-...-cd07ea3 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package utils provides some common utility functions for our controllers

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IgnoreStatusUpdatesAndDeletion

func IgnoreStatusUpdatesAndDeletion() predicate.Predicate

IgnoreStatusUpdatesAndDeletion filters out reconcile requests where only the Status was updated, or on Deletes.

**Deletes** On Deletes, we don't need to do any cleanup because we make sure to use OwnerReferences that force Kubernetes to handle the cleanup for us.

**Status Updates** Our Reconcile() loops make many updates mid-reconcile to the status fields of the objects. Doing this can cause all kinds of re-runs of the reconciler at a high rate - mostly when they are not desired.

Using this predicate filter means that the Reconcile() loops must be well tested and include their own automatic requeue-after settings.

https://sdk.operatorframework.io/docs/building-operators/golang/references/event-filtering/

func Refetch

func Refetch(ctx context.Context, reader client.Reader, obj client.Object) (*client.Object, error)

Refetch uses the "consistent client" (non-caching) to retreive the latest state of the object into the supplied object reference. This is critical to avoid "the object has been modified; please apply your changes to the latest version and try again" errors when updating object status fields.

Types

This section is empty.

Jump to

Keyboard shortcuts

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