conditions

package
v0.0.0-...-b9b4522 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Delete

func Delete(to Setter, t string)

Delete deletes the condition with the given type.

func FalseCondition

func FalseCondition(t string, reason string, message string) *metav1.Condition

FalseCondition returns a condition with Status=False and the given type.

func Get

func Get(from Getter, t string) *metav1.Condition

Get returns the condition with the given type, if the condition does not exists, it returns nil.

func GetLastTransitionTime

func GetLastTransitionTime(from Getter, t string) *metav1.Time

GetLastTransitionTime returns the condition Severity or nil if the condition does not exist (is nil).

func GetMessage

func GetMessage(from Getter, t string) string

GetMessage returns a nil safe string of Message.

func GetReason

func GetReason(from Getter, t string) string

GetReason returns a nil safe string of Reason for the condition with the given type.

func Has

func Has(from Getter, t string) bool

Has returns true if a condition with the given type exists.

func IsFalse

func IsFalse(from Getter, t string) bool

IsFalse is true if the condition with the given type is False, otherwise it return false if the condition is not False or if the condition does not exist (is nil).

func IsTrue

func IsTrue(from Getter, t string) bool

IsTrue is true if the condition with the given type is True, otherwise it return false if the condition is not True or if the condition does not exist (is nil).

func IsUnknown

func IsUnknown(from Getter, t string) bool

IsUnknown is true if the condition with the given type is Unknown or if the condition does not exist (is nil).

func MarkFalse

func MarkFalse(to Setter, t string, reason string, message string)

MarkFalse sets Status=False for the condition with the given type.

func MarkTrue

func MarkTrue(to Setter, t string, reason, message string)

MarkTrue sets Status=True for the condition with the given type.

func MarkUnknown

func MarkUnknown(to Setter, t string, reason, message string)

MarkUnknown sets Status=Unknown for the condition with the given type.

func Set

func Set(to Setter, condition *metav1.Condition)

Set sets the given condition.

NOTE: If a condition already exists, the LastTransitionTime is updated only if a change is detected in any of the following fields: Status, Reason, Severity and Message.

func TrueCondition

func TrueCondition(t string, reason string, message string) *metav1.Condition

TrueCondition returns a condition with Status=True and the given type.

func UnknownCondition

func UnknownCondition(t string, reason string, message string) *metav1.Condition

UnknownCondition returns a condition with Status=Unknown and the given type.

Types

type Getter

type Getter interface {
	client.Object

	// GetConditions returns the list of conditions for a cluster API object.
	GetConditions() []metav1.Condition
}

Getter interface defines methods that a Cluster API object should implement in order to use the conditions package for getting conditions.

type Setter

type Setter interface {
	Getter
	SetConditions([]metav1.Condition)
}

Setter interface defines methods that a Cluster API object should implement in order to use the conditions package for setting conditions.

Jump to

Keyboard shortcuts

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