Documentation
¶
Index ¶
- Constants
- func AddFalse(obj GetSet, conditionType ConditionType, conditionReason ConditionReason, ...)
- func AddTrue(obj GetSet, conditionType ConditionType)
- func EnsureConditions(obj GetSet, allConditions []ConditionType)
- func Get(obj GetSet, conditionType ConditionType) *metav1.Condition
- func IsPending(c *metav1.Condition) bool
- func IsTrue(obj GetSet, conditionType ConditionType) bool
- func JoinErrors(err error, indent int) error
- func NewCondition(condType, reason, message string, status metav1.ConditionStatus) metav1.Condition
- func NewFalseCondition(condType, reason, message string) metav1.Condition
- func NewTrueCondition(condType, reason, message string) metav1.Condition
- func NewUnknownCondition(condType, reason, message string) metav1.Condition
- func ReadyConditionMessage(message string, unreadyConditions []string) string
- func SetSummary(obj GetSet)
- func TypesAsStrings(conditionsTypes []ConditionType) []string
- type ConditionMessage
- type ConditionReason
- type ConditionType
- type GetSet
Constants ¶
const (
MessageNotReady = "The following conditions are not ready"
)
Variables ¶
This section is empty.
Functions ¶
func AddFalse ¶
func AddFalse(obj GetSet, conditionType ConditionType, conditionReason ConditionReason, conditionMessage ConditionMessage)
AddFalse adds a condition with Status=False, Reason=Pending and a specified message.
func AddTrue ¶
func AddTrue(obj GetSet, conditionType ConditionType)
AddTrue adds a condition with Status=True, Reason=Successful and Message=Reconciliation successful.
func EnsureConditions ¶
func EnsureConditions(obj GetSet, allConditions []ConditionType)
EnsureConditions ensures that all specified conditions are present. allConditions can be left nil if no conditions must be initialized.
func Get ¶
func Get(obj GetSet, conditionType ConditionType) *metav1.Condition
Get returns a condition with a specific type.
func IsPending ¶
IsPending returns true if the condition has Reason=Pending and Status=Unknown, indicating a transient state that is expected to resolve on its own.
func IsTrue ¶
func IsTrue(obj GetSet, conditionType ConditionType) bool
func JoinErrors ¶
func NewCondition ¶
func NewCondition(condType, reason, message string, status metav1.ConditionStatus) metav1.Condition
NewCondition creates a new condition with the given parameters. This is a convenience builder to reduce boilerplate when creating conditions.
func NewFalseCondition ¶
NewFalseCondition creates a condition with Status=False.
func NewTrueCondition ¶
NewTrueCondition creates a condition with Status=True.
func NewUnknownCondition ¶
NewUnknownCondition creates a condition with Status=Unknown.
func ReadyConditionMessage ¶
func SetSummary ¶
func SetSummary(obj GetSet)
SetSummary sets the overall controller condition and add a summary to the message. If we have: - only ready conditions, the reason is Success. - unready conditions, the reason will be Pending. - failed conditions, the reason is Failure. - one of the conditions is in deletion, the reason is AwaitingDeletion
func TypesAsStrings ¶
func TypesAsStrings(conditionsTypes []ConditionType) []string
Types ¶
type ConditionMessage ¶
type ConditionMessage string
ConditionMessage is the message type for the conditions.
type ConditionReason ¶
type ConditionReason string
ConditionReason is the type for the reason of a condition.
const ( // ReasonAwaitingDeletion if the controller is waiting for the deletion. ReasonAwaitingDeletion ConditionReason = "AwaitingDeletion" // ReasonPending indicates that the resource has not yet reached the expected state. ReasonPending ConditionReason = "Pending" // ReasonError is an error the system CAN recover from. ReasonError ConditionReason = "Error" // ReasonFailure is a terminal state the system CANNOT recover from. ReasonFailure ConditionReason = "Failure" // ReasonSuccess is the success reason. ReasonSuccess ConditionReason = "Success" // ReasonRetrying indicates that the operation is being retried after a failure. ReasonRetrying ConditionReason = "Retrying" )
type ConditionType ¶
type ConditionType string
ConditionType represents different types of conditions in the conditions pkg. There are generally three types of conditions:
Ready: A singleton type indicating the overall status of the controller. Possible reasons include: Success, Failure, Pending, or AwaitingDeletion.
XXXReady: Indicates the readiness status of specific resources managed by the controller. Possible reasons include: Success, Failure, Pending, or AwaitingDeletion.
XXXReconciled: Reflects the status of the reconciliation process, indicating that changes to the resource have been applied. Possible reasons include: Success, Error, Pending, or AwaitingDeletion.
const ( // TypeReady is the overall ready type for the controller. TypeReady ConditionType = "Ready" )