Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClassChangedPredicate ¶
ClassChangedPredicate is a predicate for changes in `.spec.class`.
func ConditionStatusChanged ¶
func ConditionStatusChanged(conditionType resourcesv1alpha1.ConditionType, changeFn ConditionChangeFn) predicate.Predicate
ConditionStatusChanged is a predicate that detects changes to the status of a Condition with a given type.
func HasFinalizer ¶
HasFinalizer returns a predicate that detects if the object has the given finalizer This is used to not requeue all secrets in the cluster (which might be quite a lot), but only requeue secrets from create/update events with the controller's finalizer. This is to ensure, that we properly remove the finalizer in case we missed an important update event for a ManagedResource.
Types ¶
type ConditionChangeFn ¶
type ConditionChangeFn func(con1, con2 *resourcesv1alpha1.ManagedResourceCondition) bool
ConditionChangeFn is a type for comparing two conditions.
var ConditionChangedToUnhealthy ConditionChangeFn = func(con1, con2 *resourcesv1alpha1.ManagedResourceCondition) bool { return (con1 == nil || con1.Status == resourcesv1alpha1.ConditionTrue) && (con2 != nil && con2.Status == resourcesv1alpha1.ConditionFalse) }
ConditionChangedToUnhealthy compares the given conditions and returns `true` if the `Status` has changed to an unhealthy state.
var DefaultConditionChange ConditionChangeFn = func(con1, con2 *resourcesv1alpha1.ManagedResourceCondition) bool { if con1 == nil { return con2 != nil } if con2 == nil { return true } return con1.Status != con2.Status }
DefaultConditionChange compares the given conditions and returns `true` if the `Status` has changed.