Documentation ¶
Index ¶
- Variables
- func GetCondition(conditions []gardencorev1alpha1.Condition, ...) *gardencorev1alpha1.Condition
- func GetOrInitCondition(conditions []gardencorev1alpha1.Condition, ...) gardencorev1alpha1.Condition
- func InitCondition(conditionType gardencorev1alpha1.ConditionType) gardencorev1alpha1.Condition
- func MergeConditions(oldConditions []gardencorev1alpha1.Condition, ...) []gardencorev1alpha1.Condition
- func UpdatedCondition(condition gardencorev1alpha1.Condition, ...) gardencorev1alpha1.Condition
- type ConditionBuilder
Constants ¶
This section is empty.
Variables ¶
var Now = metav1.Now
Now determines the current metav1.Time.
Functions ¶
func GetCondition ¶
func GetCondition(conditions []gardencorev1alpha1.Condition, conditionType gardencorev1alpha1.ConditionType) *gardencorev1alpha1.Condition
GetCondition returns the condition with the given <conditionType> out of the list of <conditions>. In case the required type could not be found, it returns nil.
func GetOrInitCondition ¶
func GetOrInitCondition(conditions []gardencorev1alpha1.Condition, conditionType gardencorev1alpha1.ConditionType) gardencorev1alpha1.Condition
GetOrInitCondition tries to retrieve the condition with the given condition type from the given conditions. If the condition could not be found, it returns an initialized condition of the given type.
func InitCondition ¶
func InitCondition(conditionType gardencorev1alpha1.ConditionType) gardencorev1alpha1.Condition
InitCondition initializes a new Condition with an Unknown status.
func MergeConditions ¶
func MergeConditions(oldConditions []gardencorev1alpha1.Condition, newConditions ...gardencorev1alpha1.Condition) []gardencorev1alpha1.Condition
MergeConditions merges the given <oldConditions> with the <newConditions>. Existing conditions are superseded by the <newConditions> (depending on the condition type).
func UpdatedCondition ¶
func UpdatedCondition(condition gardencorev1alpha1.Condition, status gardencorev1alpha1.ConditionStatus, reason, message string, codes ...gardencorev1alpha1.ErrorCode) gardencorev1alpha1.Condition
UpdatedCondition updates the properties of one specific condition.
Types ¶
type ConditionBuilder ¶ added in v0.34.0
type ConditionBuilder interface { WithOldCondition(old gardencorev1alpha1.Condition) ConditionBuilder WithStatus(status gardencorev1alpha1.ConditionStatus) ConditionBuilder WithReason(reason string) ConditionBuilder WithMessage(message string) ConditionBuilder WithCodes(codes ...gardencorev1alpha1.ErrorCode) ConditionBuilder WithNowFunc(now func() metav1.Time) ConditionBuilder Build() (new gardencorev1alpha1.Condition, updated bool) }
ConditionBuilder build a Condition.
func NewConditionBuilder ¶ added in v0.34.0
func NewConditionBuilder(conditionType gardencorev1alpha1.ConditionType) (ConditionBuilder, error)
NewConditionBuilder returns a ConditionBuilder for a specific condition.