conditions

package
v0.0.0-...-1f6a80c Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MessageNotReadyTemplate = "The following conditions are not ready: %s"
)

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 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"
)

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"
)

type GetSet

type GetSet interface {
	GetConditions() []metav1.Condition
	SetConditions([]metav1.Condition)
}

Jump to

Keyboard shortcuts

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