Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConditionManager ¶
type ConditionManager interface { // Add a condition and associate a polarity with it. Add(condition metav1.Condition, positive Polarity) // AddPositive Adds a condition with a positive polarity AddPositive(condition metav1.Condition) // AddNegative Adds a condition with a negative polarity AddNegative(condition metav1.Condition) // Finalize returns all conditions // not idempotent! subsequent finalizes will keep adding Parent conditions // The changed result represents whether the conditions have changed enough to warrant an update to the APIServer Finalize() (conditions []metav1.Condition, changed bool) // IsSuccessful can be called any time. Start's off true, but an // add of an unsuccessful condition (Positive-False or Negative-True) // causes this to return false IsSuccessful() bool }
ConditionManager supports collecting condition statuses for your controller It adds a complete top level condition when Finalize is called.
TBD: either error or warn if the same Condition.Type is reused TBD2: should accept an existing []Condition slice to compare against
should only update LastTransitionTime if the other fields have changed
func NewConditionManager ¶
func NewConditionManager(topLevelType string, previousConditions []metav1.Condition) ConditionManager
NewConditionManager returns a ConditionManager with a top level Condition.Type specified in topLevelType
type ConditionManagerBuilder ¶
type ConditionManagerBuilder func(topLevelType string, previousConditions []metav1.Condition) ConditionManager
Click to show internal directories.
Click to hide internal directories.