reconciler

package
v0.0.0-...-8155393 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2019 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action struct {
	// Name is a name for the Action, to be used in the CR status and log
	// messages
	Name string
	// contains filtered or unexported fields
}

Action is an action that reconciles the system state. It has a list of prerequisite actions that must be true in order for the action to be invoked.

func NewAction

func NewAction(Name string, prereqs []*Action, action func(reconcile.Request, client.Client, *runtime.Scheme) (Result, error)) *Action

NewAction is a constructor for Action.

func (*Action) Clear

func (ra *Action) Clear()

Clear and cached results of this Action

func (*Action) Execute

func (ra *Action) Execute(request reconcile.Request, client client.Client, scheme *runtime.Scheme) (Result, error)

Execute or return a previously cached result of the Action, checking prereqs first

type ActionResult

type ActionResult struct {
	Name string
	Result
}

ActionResult is the Result of an action, paired with its name

type Procedure

type Procedure struct {
	// contains filtered or unexported fields
}

Procedure defines the complete "procedure" (the set of Action) necessary to completely reconcile the state.

func NewProcedure

func NewProcedure(minVersion, version int, actions []*Action) *Procedure

NewProcedure is a constructor for Procedure

func (*Procedure) Execute

func (p *Procedure) Execute(request reconcile.Request, client client.Client, scheme *runtime.Scheme) (*ProcedureStatus, error)

Execute the reconcile Procedure

func (*Procedure) MinVersion

func (p *Procedure) MinVersion() int

MinVersion is the minimum reconciler version this Procedure can be used to upgrade from.

func (*Procedure) Version

func (p *Procedure) Version() int

Version is the reconciler version implemented by this Procedure

type ProcedureList

type ProcedureList []Procedure

ProcedureList is used to define all the reconcile Procedures for the operator

func (ProcedureList) Newest

func (pl ProcedureList) Newest() (*Procedure, error)

Newest returns the Procedure with the highest version number

func (ProcedureList) NewestCompatible

func (pl ProcedureList) NewestCompatible(currentVersion *int) (*Procedure, error)

NewestCompatible returns the newest Procedure compatible to *version or the newest available one if version is nil.

type ProcedureStatus

type ProcedureStatus struct {
	// Results will contain an entry for each action that was attempted
	// while executing the Procedure
	Results []ActionResult
	// FullyReconciled will be true iff the system state was found to be
	// full reconciled according to the Procedure
	FullyReconciled bool
}

ProcedureStatus is the result of executing a reconcile Procedure

type Result

type Result struct {
	// Status describes the outcome of the action. If True, the action found
	// the system state to already be fully reconciled, thus requiring no
	// action.
	Status corev1.ConditionStatus
	// Message is a short human-readable explanation of the result
	Message string
}

Result is the result of a Action

Jump to

Keyboard shortcuts

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