detect local cluster states
This commit is contained in:
@@ -7,9 +7,46 @@ import (
|
||||
"undecided.project/monok8s/pkg/system"
|
||||
)
|
||||
|
||||
type Step func(context.Context, *NodeContext) error
|
||||
|
||||
type NodeContext struct {
|
||||
Config *monov1alpha1.MonoKSConfig
|
||||
SystemRunner *system.Runner
|
||||
Config *monov1alpha1.MonoKSConfig
|
||||
SystemRunner *system.Runner
|
||||
LocalClusterState *LocalClusterState
|
||||
BootstrapState *BootstrapState
|
||||
}
|
||||
|
||||
type Step func(context.Context, *NodeContext) error
|
||||
type LocalMembershipKind string
|
||||
|
||||
const (
|
||||
LocalMembershipFresh LocalMembershipKind = "fresh"
|
||||
LocalMembershipExistingWorker LocalMembershipKind = "existing-worker"
|
||||
LocalMembershipExistingControlPlane LocalMembershipKind = "existing-control-plane"
|
||||
LocalMembershipPartial LocalMembershipKind = "partial"
|
||||
)
|
||||
|
||||
type LocalClusterState struct {
|
||||
HasAdminKubeconfig bool
|
||||
HasKubeletKubeconfig bool
|
||||
MembershipKind LocalMembershipKind
|
||||
}
|
||||
|
||||
type BootstrapAction string
|
||||
|
||||
const (
|
||||
BootstrapActionInitControlPlane BootstrapAction = "init-control-plane"
|
||||
BootstrapActionJoinWorker BootstrapAction = "join-worker"
|
||||
BootstrapActionJoinControlPlane BootstrapAction = "join-control-plane"
|
||||
BootstrapActionReconcileWorker BootstrapAction = "reconcile-worker"
|
||||
BootstrapActionReconcileControlPlane BootstrapAction = "reconcile-control-plane"
|
||||
BootstrapActionUpgradeWorker BootstrapAction = "upgrade-worker"
|
||||
BootstrapActionUpgradeControlPlane BootstrapAction = "upgrade-control-plane"
|
||||
)
|
||||
|
||||
type BootstrapState struct {
|
||||
Action BootstrapAction
|
||||
DetectedClusterVersion string
|
||||
|
||||
UnsupportedWorkerVersionSkew bool
|
||||
VersionSkewReason string
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user