Documentation
¶
Index ¶
- Constants
- type Condition
- type ConditionSet
- func (c ConditionSet) Clear(t string) error
- func (c ConditionSet) Get(t string) *Condition
- func (c ConditionSet) IsDependentCondition(t string) bool
- func (c ConditionSet) IsTrue(conditionTypes ...string) bool
- func (c ConditionSet) List() []Condition
- func (c ConditionSet) Root() *Condition
- func (c ConditionSet) Set(condition Condition) (modified bool)
- func (c ConditionSet) SetFalse(conditionType string, reason, message string) (modified bool)
- func (c ConditionSet) SetTrue(conditionType string) (modified bool)
- func (c ConditionSet) SetTrueWithReason(conditionType string, reason, message string) (modified bool)
- func (c ConditionSet) SetUnknown(conditionType string) (modified bool)
- func (c ConditionSet) SetUnknownWithReason(conditionType string, reason, message string) (modified bool)
- type ConditionType
- type ConditionTypes
- type Object
Constants ¶
const ( // ConditionReady specifies that the resource is ready. // For long-running resources. ConditionReady = "Ready" // ConditionSucceeded specifies that the resource has finished. // For resource which run to completion. ConditionSucceeded = "Succeeded" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Condition ¶
Condition aliases the upstream type and adds additional helper methods
func (*Condition) GetStatus ¶
func (c *Condition) GetStatus() metav1.ConditionStatus
type ConditionSet ¶
type ConditionSet struct { ConditionTypes // contains filtered or unexported fields }
ConditionSet provides methods for evaluating Conditions. +k8s:deepcopy-gen=false
func (ConditionSet) Clear ¶
func (c ConditionSet) Clear(t string) error
Clear removes the independent condition that matches the ConditionType Not implemented for dependent conditions
func (ConditionSet) Get ¶
func (c ConditionSet) Get(t string) *Condition
Get finds and returns the Condition that matches the ConditionType previously set on Conditions.
func (ConditionSet) IsDependentCondition ¶
func (c ConditionSet) IsDependentCondition(t string) bool
IsDependentCondition returns true if the provided condition is involved in calculating the root condition.
func (ConditionSet) IsTrue ¶
func (c ConditionSet) IsTrue(conditionTypes ...string) bool
IsTrue returns true if all condition types are true.
func (ConditionSet) List ¶
func (c ConditionSet) List() []Condition
func (ConditionSet) Root ¶
func (c ConditionSet) Root() *Condition
Root returns the root Condition, typically "Ready" or "Succeeded"
func (ConditionSet) Set ¶
func (c ConditionSet) Set(condition Condition) (modified bool)
Set sets or updates the Condition on Conditions for Condition.Type. If there is an update, Conditions are stored back sorted.
func (ConditionSet) SetFalse ¶
func (c ConditionSet) SetFalse(conditionType string, reason, message string) (modified bool)
SetFalse sets the status of conditionType and the root condition to False.
func (ConditionSet) SetTrue ¶
func (c ConditionSet) SetTrue(conditionType string) (modified bool)
SetTrue sets the status of conditionType to true with the reason, and then marks the root condition to true if all other dependents are also true.
func (ConditionSet) SetTrueWithReason ¶
func (c ConditionSet) SetTrueWithReason(conditionType string, reason, message string) (modified bool)
SetTrueWithReason sets the status of conditionType to true with the reason, and then marks the root condition to true if all other dependents are also true.
func (ConditionSet) SetUnknown ¶
func (c ConditionSet) SetUnknown(conditionType string) (modified bool)
SetUnknown sets the status of conditionType to Unknown and also sets the root condition to Unknown if no other dependent condition is in an error state.
func (ConditionSet) SetUnknownWithReason ¶
func (c ConditionSet) SetUnknownWithReason(conditionType string, reason, message string) (modified bool)
SetUnknownWithReason sets the status of conditionType to Unknown with the reason, and also sets the root condition to Unknown if no other dependent condition is in an error state.
type ConditionType ¶
type ConditionType string
ConditionType is an upper-camel-cased condition type.
type ConditionTypes ¶
type ConditionTypes struct {
// contains filtered or unexported fields
}
ConditionTypes is an abstract collection of the possible ConditionType values that a particular resource might expose. It also holds the "root condition" for that resource, which we define to be one of Ready or Succeeded depending on whether it is a Living or Batch process respectively.
func NewReadyConditions ¶
func NewReadyConditions(d ...string) ConditionTypes
NewReadyConditions returns a ConditionTypes to hold the conditions for the resource. ConditionReady is used as the root condition. The set of condition types provided are those of the terminal sub-conditions.
func NewSucceededConditions ¶
func NewSucceededConditions(d ...string) ConditionTypes
NewSucceededConditions returns a ConditionTypes to hold the conditions for the batch resource. ConditionSucceeded is used as the root condition. The set of condition types provided are those of the terminal sub-conditions.
func (ConditionTypes) DependsOn ¶
func (ct ConditionTypes) DependsOn(d string) bool
DependsOn is a helper function to determine if deps contains the provided condition type.
func (ConditionTypes) For ¶
func (ct ConditionTypes) For(object Object) ConditionSet
For creates a ConditionSet from an object using the original ConditionTypes as a reference. Status must be a pointer to a struct.