controllerutils

package
v0.17.12 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2021 License: Apache-2.0 Imports: 8 Imported by: 44

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ObjectMetasEqual

func ObjectMetasEqual(obj1, obj2 metav1.Object) bool

returns true if "relevant" parts of obj1 and obj2 have equal: -labels -annotations -namespace+name or if the objects are not metav1.Objects

func ObjectStatusesEqual

func ObjectStatusesEqual(obj1, obj2 runtime.Object) bool

returns true if the Status of obj1 and obj2 are equal. The objects should have a field named Status or this function will panic.

func ObjectsEqual

func ObjectsEqual(obj1, obj2 runtime.Object) bool

returns true if "relevant" parts of obj1 and obj2 have equal: - labels, - annotations, - namespace+name, - non-metadata, non-status fields Note that Status fields are not compared. To compare status fields, use ObjectStatusesEqual

func UpdateStatus

Easily Update the Status of a desired object in the cluster. Requires that the object already exists (will only attempt to update).

If the desired object status is semantically equal to the existing object status, the update is skipped.

func Upsert

func Upsert(ctx context.Context, c client.Client, obj client.Object, transitionFuncs ...TransitionFunc) (controllerutil.OperationResult, error)

Easily Upsert a desired object to the cluster.

If the object exists, the provided TransitionFuncs will be called. Resource version for the desired object will be set automatically.

If the desired object (after applying transition funcs) is semantically equal to the existing object, the update is skipped.

Types

type TransitionFunc

type TransitionFunc func(existing, desired runtime.Object) error

TransitionFunc performs a comparison of the the existing object with the desired object before a desired object is Upserted to kube storage.

Jump to

Keyboard shortcuts

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