phases

package
v0.0.0-...-d2dd387 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2025 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	StopOperationCondition = errors.New("StopOperationCondition")
)

Functions

func NewDefaultPhasedExecutionContext

func NewDefaultPhasedExecutionContext(onPhaseFunc DefaultOnPhaseFunc) *phasedExecutionContext[interface{}]

func NewPhasedExecutionContext

func NewPhasedExecutionContext[OperationPhaseDataT any](onPhaseFunc OnPhaseFunc[OperationPhaseDataT]) *phasedExecutionContext[OperationPhaseDataT]

Types

type DefaultOnPhaseFunc

type DefaultOnPhaseFunc OnPhaseFunc[interface{}]

type DefaultPhasedExecutionContext

type DefaultPhasedExecutionContext PhasedExecutionContext[interface{}]

type DhctlState

type DhctlState map[string][]byte

func ExtractDhctlState

func ExtractDhctlState(stateCache state.Cache) (res DhctlState, err error)

type OnPhaseFunc

type OnPhaseFunc[OperationPhaseDataT any] func(completedPhase OperationPhase, completedPhaseState DhctlState, completedPhaseData OperationPhaseDataT, nextPhase OperationPhase, nextPhaseCritical bool) error

type OperationPhase

type OperationPhase string
const (
	// bootstrap and converge both
	BaseInfraPhase OperationPhase = "BaseInfra"
	// bootstrap only
	RegistryPackagesProxyPhase             OperationPhase = "RegistryPackagesProxyBundle"
	ExecuteBashibleBundlePhase             OperationPhase = "ExecuteBashibleBundle"
	InstallDeckhousePhase                  OperationPhase = "InstallDeckhouse"
	CreateResourcesPhase                   OperationPhase = "CreateResources"
	InstallAdditionalMastersAndStaticNodes OperationPhase = "InstallAdditionalMastersAndStaticNodes"
	DeleteResourcesPhase                   OperationPhase = "DeleteResources"
	ExecPostBootstrapPhase                 OperationPhase = "ExecPostBootstrap"
	// converge only
	AllNodesPhase            OperationPhase = "AllNodes"
	ScaleToMultiMasterPhase  OperationPhase = "ScaleToMultiMaster"
	ScaleToSingleMasterPhase OperationPhase = "ScaleToSingleMaster"
	// all
	FinalizationPhase OperationPhase = "Finalization"
)

Define common operations phases for such operations as bootstrap, converge and destroy. Notice that each operation could define own phases (like attach operation do).

type PhasedExecutionContext

type PhasedExecutionContext[OperationPhaseDataT any] interface {
	InitPipeline(stateCache dstate.Cache) error
	Finalize(stateCache dstate.Cache) error
	StartPhase(phase OperationPhase, isCritical bool, stateCache dstate.Cache) (bool, error)
	CompletePhase(stateCache dstate.Cache, completedPhaseData OperationPhaseDataT) error
	CompletePipeline(stateCache dstate.Cache) error
	SwitchPhase(phase OperationPhase, isCritical bool, stateCache dstate.Cache, completedPhaseData OperationPhaseDataT) (bool, error)
	CompletePhaseAndPipeline(stateCache dstate.Cache, completedPhaseData OperationPhaseDataT) error
	GetLastState() DhctlState
}

Jump to

Keyboard shortcuts

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