Documentation
¶
Overview ¶
Package conditions provides utilities for managing status conditions on Kubernetes API objects.
Index ¶
- func Del(target Setter, conditionType string) (changed bool)
- func FromError(err error) metav1.Condition
- func GetTopLevelCondition(target Getter) *metav1.Condition
- func InitializeConditions(target Setter, types ...string) (changed bool)
- func IsReady(target Getter) bool
- func RecomputeReady(target Setter) (changed bool)
- func Set(target Setter, condition metav1.Condition) (changed bool)
- func Sort(conditions []metav1.Condition)
- type Getter
- type Setter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Del ¶
Del removes a condition of the specified type from the target object. It returns true if the condition was removed, false otherwise.
func FromError ¶
FromError creates a v1alpha1.ConfiguredCondition from the given error. If the error is nil, it returns a condition indicating success. If the error is a gRPC status error, it extracts the code and message to populate the condition's Reason and Message fields.
func GetTopLevelCondition ¶
GetTopLevelCondition finds and returns the top level condition (Ready Condition).
func InitializeConditions ¶
InitializeConditions updates all conditions to Unknown if not set.
func IsReady ¶
IsReady looks at the v1alpha1.ReadyCondition condition type and returns true if that condition is set to true and the observed generation matches the object's generation.
func RecomputeReady ¶
RecomputeReady recomputes the Ready Condition based on all other conditions. It sets the Ready Condition to false if any other condition is not ready, or to true if all other conditions are ready.