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 ¶
type StateHandler func(ctx context.Context, r ReconcilerInterface, resource StateManagedResource) (kodev1alpha2.Phase, ctrl.Result, error)
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 (sm *StateMachine) HandleState(ctx context.Context, r ReconcilerInterface, resource StateManagedResource) (ctrl.Result, error)
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
Click to show internal directories.
Click to hide internal directories.