Documentation ¶
Index ¶
- Constants
- Variables
- func CreateCondition(conditions []metav1.Condition, condition metav1.Condition, unsetReason string) []metav1.Condition
- func GetCondition(conditions []metav1.Condition, condition string) metav1.Condition
- func InvertStatus(status metav1.ConditionStatus) metav1.ConditionStatus
- func UpdateConditionIfChanged(conditions []metav1.Condition, condition metav1.Condition) []metav1.Condition
- type WrappedStatus
Constants ¶
View Source
const ( StatusTrue = "True" StatusFalse = "False" )
Variables ¶
View Source
var EmptyCondition = metav1.Condition{}
Functions ¶
func CreateCondition ¶
func CreateCondition(conditions []metav1.Condition, condition metav1.Condition, unsetReason string) []metav1.Condition
CreateCondition sets a condition only if it has not already been set
func GetCondition ¶
func InvertStatus ¶
func InvertStatus(status metav1.ConditionStatus) metav1.ConditionStatus
InvertStatus returns the opposite of the provided status. If an invalid status is passed in, False is returned
Types ¶
type WrappedStatus ¶
type WrappedStatus struct { // Status is the object that is wrapped. config.Status // Dirty indicates if this object has been modified at all. // Note: only changes wrapped in Mutate are tracked. Dirty bool }
WrappedStatus provides a wrapper around a status message that keeps track of whether or not any changes have been made. This allows users to declarative write status, without worrying about tracking changes. When read to commit (typically to Kubernetes), any messages with Dirty=false can be discarded.
func Wrap ¶
func Wrap(s config.Status) *WrappedStatus
func (*WrappedStatus) Mutate ¶
func (w *WrappedStatus) Mutate(f func(s config.Status) config.Status)
func (*WrappedStatus) Unwrap ¶
func (w *WrappedStatus) Unwrap() config.Status
Click to show internal directories.
Click to hide internal directories.