Documentation ¶
Index ¶
- func ObjectMetasEqual(obj1, obj2 metav1.Object) bool
- func ObjectStatusesEqual(obj1, obj2 runtime.Object) bool
- func ObjectsEqual(obj1, obj2 runtime.Object) bool
- func UpdateStatus(ctx context.Context, c client.Client, obj client.Object) (controllerutil.OperationResult, error)
- func UpdateStatusImmutable(ctx context.Context, c client.Client, obj client.Object) (controllerutil.OperationResult, error)
- func Upsert(ctx context.Context, c client.Client, obj client.Object, ...) (controllerutil.OperationResult, error)
- type TransitionFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ObjectMetasEqual ¶
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 ¶
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 ¶
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 ¶
func UpdateStatus( ctx context.Context, c client.Client, obj client.Object, ) (controllerutil.OperationResult, error)
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 UpdateStatusImmutable ¶ added in v0.7.17
func UpdateStatusImmutable( ctx context.Context, c client.Client, obj client.Object, ) (controllerutil.OperationResult, error)
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. Unlike the method above, this method does not update obj.
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 ¶
TransitionFunc performs a comparison of the the existing object with the desired object before a desired object is Upserted to kube storage.