Some basic agent startup

This commit is contained in:
2026-03-30 21:50:04 +08:00
parent fcf7371e9e
commit bdbc29649c
11 changed files with 98 additions and 48 deletions

View File

@@ -38,6 +38,7 @@ func NewRegistry(ctx *node.NodeContext) *Registry {
"RunKubeadmUpgradeApply": node.RunKubeadmUpgradeApply,
"RunKubeadmUpgradeNode": node.RunKubeadmUpgradeNode,
"StartCRIO": node.StartCRIO,
"StartControlAgent": node.StartControlAgent,
"ValidateNodeIPAndAPIServerReachability": node.ValidateNodeIPAndAPIServerReachability,
"ValidateRequiredImagesPresent": node.ValidateRequiredImagesPresent,
"WaitForExistingClusterIfNeeded": node.WaitForExistingClusterIfNeeded,
@@ -45,14 +46,6 @@ func NewRegistry(ctx *node.NodeContext) *Registry {
}
}
func (r *Registry) MustGet(name string) node.Step {
step, ok := r.steps[name]
if !ok {
panic(fmt.Sprintf("unknown step %q", name))
}
return step
}
func (r *Registry) Get(name string) (node.Step, error) {
step, ok := r.steps[name]
if !ok {

View File

@@ -4,6 +4,7 @@ import (
"context"
"fmt"
"k8s.io/klog/v2"
monov1alpha1 "undecided.project/monok8s/pkg/apis/monok8s/v1alpha1"
"undecided.project/monok8s/pkg/node"
"undecided.project/monok8s/pkg/system"
@@ -131,6 +132,11 @@ func NewRunner(cfg *monov1alpha1.MonoKSConfig) *Runner {
Name: "Apply node metadata",
Desc: "Apply labels/annotations to the local node if API server is reachable",
},
{
RegKey: "StartControlAgent",
Name: "Starts the Control Agent",
Desc: "Handles OSUpgrade resources polling",
},
},
}
}
@@ -153,6 +159,7 @@ func (r *Runner) Init(ctx context.Context) error {
return fmt.Errorf("step %d (%s): %w", i+1, step.Name, err)
}
}
klog.Info("All steps completed successfully")
return nil
}