helper

package
v1.69.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 24, 2023 License: Apache-2.0, BSD-2-Clause, MIT, + 1 more Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Now = metav1.Now

Now determines the current metav1.Time.

Functions

func GetCondition

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

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL