controller

package
v0.0.0-...-ba840aa Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// InitState is the initial state of the state machine
	InitState = "init"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type StateMachineManager

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

StateMachineManager is a simple state machine manager which controls the state transitions

func NewStateMachineManager

func NewStateMachineManager(currentState string, states []kubetessaiov1.State) *StateMachineManager

NewStateMachineManager creates a new state machine manager

func (*StateMachineManager) Add

func (sm *StateMachineManager) Add(currentState, nextState string)

Add adds a new state transition to the manager

func (*StateMachineManager) Exist

func (sm *StateMachineManager) Exist(state string) bool

Add adds a new state transition to the manager

func (*StateMachineManager) Next

func (sm *StateMachineManager) Next() *string

Next returns the next state and advances the current state of the state machine

type StateMachineReconciler

type StateMachineReconciler struct {
	client.Client
	Scheme *runtime.Scheme
	// contains filtered or unexported fields
}

StateMachineReconciler reconciles a StateMachine object

func (*StateMachineReconciler) Reconcile

func (r *StateMachineReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state. TODO(user): Modify the Reconcile function to compare the state specified by the StateMachine object against the actual cluster state, and then perform operations to make the cluster state reflect the state specified by the user.

func (*StateMachineReconciler) ReconcileStates

func (r *StateMachineReconciler) ReconcileStates(ctx context.Context, stateMachine *kubetessaiov1.StateMachine) error

func (*StateMachineReconciler) SetupWithManager

func (r *StateMachineReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳