Documentation ¶
Index ¶
- Variables
- func Equivalent(i, j *Intent) bool
- type Input
- type Intent
- func (i *Intent) Actionable() bool
- func (i Intent) Clone() *Intent
- func (i *Intent) DegradedPath() bool
- func (i *Intent) DisplayString() string
- func (i *Intent) Errored() bool
- func (i *Intent) GetAnnotations() map[string]string
- func (i *Intent) GetLabels() map[string]string
- func (i *Intent) GetName() string
- func (i *Intent) HasUpdateAvailable() bool
- func (i *Intent) InProgress() bool
- func (i *Intent) Intrusive() bool
- func (i *Intent) Projected() *Intent
- func (i *Intent) Realized() bool
- func (i *Intent) Reset() *Intent
- func (i *Intent) SetBeginUpdate() *Intent
- func (i *Intent) SetUpdateAvailable(available bool) *Intent
- func (i *Intent) Stuck() bool
- func (i *Intent) Terminal() bool
- func (i *Intent) Waiting() bool
Constants ¶
This section is empty.
Variables ¶
var FallbackNodeAction = func() marker.NodeAction { n, _ := calculateNext(marker.NodeActionUnknown) return n }()
FallbackNodeAction is the first recovery action that is reasonble to take from an unknown point.
Functions ¶
func Equivalent ¶
Equivalent compares intentional state to determine equivalency.
Types ¶
type Input ¶
type Input interface { marker.Container // GetName returns the Input's addressable Name. GetName() string }
Input is a suitable container of data for interpreting an Intent from. This effectively is a subset of the kubernetes' v1.Node accessors, but is more succinct and scoped to the used accessors.
type Intent ¶
type Intent struct { // NodeName is the Resource name that addresses it. NodeName string // Wanted is the currently instructed action on the node. Wanted marker.NodeAction // Active is the current action taken on the Node. Active marker.NodeAction // State is the current status or state of the Node reported, generally for // the Active action. State marker.NodeState // UpdateAvailable is the Node's status of having an update ready to apply. UpdateAvailable marker.NodeUpdate }
Intent is the sole communicator of state progression and desired intentions for an Agent to act upon and to communicate its progress.
func Given ¶
Given determines the commuincated intent from a Node without projecting into its next steps.
func (*Intent) Actionable ¶
Needed indicates that the intent is needing progress made on it.
func (Intent) Clone ¶
Clone returns a copy of the Intent to mutate independently of the source instance.
func (*Intent) DegradedPath ¶
DegradedPaths indicates that the intent will derail and step into an unknown step if it has not already.
func (*Intent) DisplayString ¶
func (*Intent) Errored ¶
Errored indicates that the intention was not realized and failed in attempt to do so.
func (*Intent) GetAnnotations ¶
GetAnnotations transposes the Intent into a map of Annotations suitable for adding to a Resource.
func (*Intent) GetLabels ¶
GetLabels transposes the Intent into a map of Labels suitable for adding to a Resource.
func (*Intent) HasUpdateAvailable ¶
HasUpdateAvailable indicates the Node has flagged itself as needing an update.
func (*Intent) InProgress ¶
InProgess reports true when the Intent is for a node that is actively making progress towards completing an update.
func (*Intent) Projected ¶
Projected returns the n+1 step projection of a would-be Intent. It does not check whether or not the next step is correct given the current intent (ie: this will not error if the node has not actually completed a step).
func (*Intent) Reset ¶
Reset brings the intent back to the start of the progression where the intent may be able to resolve issues and fall into a valid state.
func (*Intent) SetBeginUpdate ¶
func (*Intent) SetUpdateAvailable ¶
SetUpdateAvailable modifies the intent to reflect the provided available state.
func (*Intent) Stuck ¶
Stuck intents are those that cannot be realized or are terminal in their current state and should be unstuck. If terminal handling is needed, the caller should use Intent.Terminal() to detect this case.
func (*Intent) Terminal ¶
Terminal indicates that the intent has reached a terminal point in the progression, the intent will not make progress in anyway without outside state action.
func (*Intent) Waiting ¶
Waiting reports true when a Node is prepared and waiting to make further commanded progress towards completing an update. This doesn't however indicate whether or not the intent reached a waiting state successfully or not. Utilize other checks to assert a combinational check.