Documentation
¶
Index ¶
- type Map
- type Mapper
- type State
- func (s *State) AllIntEqual(status metav1.ConditionStatus, conditions ...string) bool
- func (s *State) ConditionByInt(cond string, condStatus metav1.ConditionStatus, internalCond string) metav1.Condition
- func (s *State) ExtEqual(cond string, status metav1.ConditionStatus) bool
- func (s *State) GetExtReason(cond string) (string, string)
- func (s *State) GetIntReason(cond string) (string, string)
- func (s *State) GetIntStatus(cond string) (metav1.ConditionStatus, bool)
- func (s *State) HasExt(cond string) bool
- func (s *State) HasInt(cond string) bool
- func (s *State) IntEqual(cond string, status metav1.ConditionStatus) bool
- func (s *State) IsUpdating() bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Map ¶
Map computes at most one external condition from a mapping state. Return an empty condition to leave that external condition unchanged.
type Mapper ¶
type Mapper struct {
// Maps is the ordered list of condition maps. Order matters when callers
// care about deterministic condition update ordering.
Maps []Map
}
Mapper applies condition maps to compute external conditions.
type State ¶
type State struct {
Updating bool // true when a version change is in progress
Internal map[string]metav1.Condition // task-set conditions, keyed by condition type
External map[string]metav1.Condition // previously computed user-facing conditions, read-only during mapping
}
State is the snapshot fed into a single mapping run. Internal holds conditions set by operator tasks (inputs to mapping). External holds user-facing conditions from the previous run; rules read it to implement sticky and guard behavior (e.g. Installed stays True once set).
func (*State) AllIntEqual ¶
func (s *State) AllIntEqual(status metav1.ConditionStatus, conditions ...string) bool
AllIntEqual reports whether every listed internal condition has the given status. It returns false if any condition is absent.
func (*State) ConditionByInt ¶
func (s *State) ConditionByInt(cond string, condStatus metav1.ConditionStatus, internalCond string) metav1.Condition
ConditionByInt builds an external condition that passes through reason and message from an internal condition. The result has empty reason if the internal condition has none — callers that need fallback handling should use their own helper.
func (*State) ExtEqual ¶
func (s *State) ExtEqual(cond string, status metav1.ConditionStatus) bool
ExtEqual reports whether the external condition has the given status. Returns false if the condition is absent.
func (*State) GetExtReason ¶
GetExtReason returns the Reason and Message of an external condition. Returns ("", "") if the condition is absent.
func (*State) GetIntReason ¶
GetIntReason returns the Reason and Message of an internal condition. Returns ("", "") if the condition is absent.
func (*State) GetIntStatus ¶
func (s *State) GetIntStatus(cond string) (metav1.ConditionStatus, bool)
GetIntStatus returns the status of an internal condition. Returns ("", false) if the condition is absent.
func (*State) IntEqual ¶
func (s *State) IntEqual(cond string, status metav1.ConditionStatus) bool
IntEqual reports whether the internal condition has the given status. Returns false if the condition is absent.
func (*State) IsUpdating ¶
IsUpdating reports whether this mapping run observes a version change.