statemachine

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ReconcilerInterface

type ReconcilerInterface interface {
	GetClient() client.Client
	GetScheme() *runtime.Scheme
	GetLog() logr.Logger
	GetEventRecorder() event.EventManager
	GetResourceManager() resourcev1.ResourceManager
	GetTemplateManager() template.TemplateManager
	GetCleanupManager() cleanup.CleanupManager
	GetIsTestEnvironment() bool
	GetReconcileInterval() time.Duration
	GetLongReconcileInterval() time.Duration
}

ReconcilerInterface defines the common interface for reconcilers

type StateHandler

StateHandler defines the function signature for state handlers

type StateMachine

type StateMachine struct {
	Handlers map[kodev1alpha2.Phase]StateHandler
	Client   client.Client
	Log      logr.Logger
}

func NewStateMachine

func NewStateMachine(c client.Client, log logr.Logger) *StateMachine

func (*StateMachine) HandleState

func (*StateMachine) RegisterHandler

func (sm *StateMachine) RegisterHandler(phase kodev1alpha2.Phase, handler StateHandler)

type StateManagedResource

type StateManagedResource interface {
	GetName() string
	GetNamespace() string
	GetPhase() kodev1alpha2.Phase
	SetPhase(phase kodev1alpha2.Phase)
	UpdateStatus(ctx context.Context, c client.Client) error
	SetCondition(conditionType constant.ConditionType, status metav1.ConditionStatus, reason, message string)
	GetCondition(conditionType constant.ConditionType) *metav1.Condition
	DeleteCondition(conditionType constant.ConditionType)
	GetFinalizer() string
	AddFinalizer(ctx context.Context, c client.Client) error
	RemoveFinalizer(ctx context.Context, c client.Client) error
}

StateManagedResource defines the interface for resources managed by the state machine

Jump to

Keyboard shortcuts

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