statemachine

package
v0.0.0-...-a7b7215 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2024 License: UPL-1.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteTracker

func DeleteTracker(CR client.Object)

DeleteTracker deletes the tracker for the given CR

func GetPreInstallTime

func GetPreInstallTime(cr client.Object) *time.Time

GetPreInstallTime returns the time right before preinstall is called

Types

type StateMachine

type StateMachine struct {
	CR      client.Object
	Handler handlerspi.StateMachineHandler
}

StateMachine contains the fields needed to execute the state machine.

func (*StateMachine) Execute

func (s *StateMachine) Execute(handlerContext handlerspi.HandlerContext) result.Result

Execute runs the state machine starting at the state stored in the tracker. Each CR has a unique tracker for a given generation that tracks the current state. The state machine uses a work handler to implement module specific logic. This state machine code is used by different types of controllers, such as the Module and ModuleAction controllers. It is important to note that if the CR generation increments, then a new tracker is created and the state machine starts from the beginning.

During state machine execution, a result may be returned to indicate that the controller-runtime should requeue after a delay. This is done when a handler is waiting for a resource or some other condition.

Jump to

Keyboard shortcuts

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