Documentation
¶
Index ¶
- func ApplyPatchIfNotEmpty[T client.Object](ctx context.Context, cl client.Client, logger logr.Logger, existingResource T, ...) (res op.Result, deploy T, err error)
- func ApplyStatusPatchIfNotEmpty[T client.Object](ctx context.Context, cl client.Client, logger logr.Logger, existing T, ...) (res op.Result, err error)
- func SetStatusWithConditionIfDifferent[T interface{ ... }](ent T, conditionType kcfgconsts.ConditionType, ...) bool
- func StatusWithCondition[T interface{ ... }](ctx context.Context, cl client.Client, ent T, ...) (ctrl.Result, error)
- func StatusWithConditions[T interface{ ... }](ctx context.Context, cl client.Client, ent T, conditions ...metav1.Condition) (res ctrl.Result, updated bool, err error)
- func WithFinalizer[T client.Object](ctx context.Context, cl client.Client, ent T, finalizer string) (bool, ctrl.Result, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplyPatchIfNotEmpty ¶ added in v1.4.0
func ApplyPatchIfNotEmpty[ T client.Object, ]( ctx context.Context, cl client.Client, logger logr.Logger, existingResource T, oldExistingResource T, updated bool, ) (res op.Result, deploy T, err error)
ApplyPatchIfNotEmpty patches the provided resource if the resulting patch between the provided existingResource and the provided oldExistingResource is non empty.
func ApplyStatusPatchIfNotEmpty ¶ added in v1.4.0
func ApplyStatusPatchIfNotEmpty[ T client.Object, ]( ctx context.Context, cl client.Client, logger logr.Logger, existing T, oldExisting T, ) (res op.Result, err error)
ApplyStatusPatchIfNotEmpty patches the provided object if the resulting patch between the provided existing and oldExisting is non empty.
func SetStatusWithConditionIfDifferent ¶ added in v1.4.0
func SetStatusWithConditionIfDifferent[T interface { client.Object k8sutils.ConditionsAware }]( ent T, conditionType kcfgconsts.ConditionType, conditionStatus metav1.ConditionStatus, conditionReason kcfgconsts.ConditionReason, conditionMessage string, ) bool
SetStatusWithConditionIfDifferent sets the status of the provided object with the given condition if the condition is different from the current one. It does not take LastTransitionTime into account. The return value tells whether status needs an update.
func StatusWithCondition ¶ added in v1.4.0
func StatusWithCondition[T interface { client.Object k8sutils.ConditionsAware }]( ctx context.Context, cl client.Client, ent T, conditionType kcfgconsts.ConditionType, conditionStatus metav1.ConditionStatus, conditionReason kcfgconsts.ConditionReason, conditionMessage string, ) (ctrl.Result, error)
StatusWithCondition patches the status of the provided object with the given condition. If the condition is already set and it's as expected, it returns without patching.
func StatusWithConditions ¶ added in v1.5.0
func StatusWithConditions[T interface { client.Object k8sutils.ConditionsAware }]( ctx context.Context, cl client.Client, ent T, conditions ...metav1.Condition, ) (res ctrl.Result, updated bool, err error)
StatusWithConditions patches the status of the provided object with the given conditions.
Types ¶
This section is empty.