conditions

package
v0.4.3 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2026 License: Apache-2.0 Imports: 5 Imported by: 1

Documentation

Index

Constants

View Source
const (
	ReadyCondition = "Ready"

	ReasonComplete = "Complete"
	ReasonPending  = "Pending"
	ReasonStopped  = "Stopped"
	ReasonSkipped  = "Skipped"
	ReasonError    = "Error"
	ReasonUnknown  = "Unknown"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ConditionAccessor

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

ConditionAccessor is implemented by objects that expose status conditions.

type Manager

type Manager struct{}

Manager manages per-subroutine and aggregate Ready conditions on objects that implement ConditionAccessor.

func NewManager

func NewManager() *Manager

NewManager creates a new condition Manager.

func (*Manager) InitUnknownConditions

func (m *Manager) InitUnknownConditions(obj client.Object, subroutineNames []string)

InitUnknownConditions sets per-subroutine and Ready conditions to Unknown if they are not already present.

func (*Manager) SetReadyCondition

func (m *Manager) SetReadyCondition(obj client.Object, reason string)

SetReadyCondition sets the aggregate Ready condition based on the given reason. The reason must be one of ReasonComplete, ReasonError, ReasonPending, or ReasonStopped.

func (*Manager) SetSkippedConditions

func (m *Manager) SetSkippedConditions(obj client.Object, names []string, ready bool, msg string)

SetSkippedConditions sets conditions for the given subroutine names to Skipped. When ready is true, condition status is True; when false, condition status is False.

func (*Manager) SetSubroutineCondition

func (m *Manager) SetSubroutineCondition(obj client.Object, name string, result subroutines.Result, err error, isFinalize bool)

SetSubroutineCondition maps a subroutine result/error to a condition on the object. The action determines the condition name suffix (finalize/terminate actions append "Finalize").

Jump to

Keyboard shortcuts

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