Drafting ctl controller

This commit is contained in:
2026-04-20 02:50:04 +08:00
parent c6b399ba22
commit 6ddff7c433
52 changed files with 3093 additions and 347 deletions

View File

@@ -28,6 +28,33 @@ var (
}
)
func EnsureOSUpgradeProgressForNode(
ctx context.Context,
clients *kube.Clients,
namespace string,
nodeName string,
osu *monov1alpha1.OSUpgrade,
) error {
if osu == nil {
return fmt.Errorf("osupgrade is nil")
}
// Keep using your existing helper if it already encapsulates
// selector matching / parent linkage / create-or-update semantics.
osup, err := ensureProgressHeartbeat(ctx, clients, namespace, nodeName, osu)
if err != nil {
return err
}
klog.InfoS("ensured OSUpgradeProgress from admission",
"osupgrade", osu.Name,
"osupgradeProgress", osup.Name,
"node", nodeName,
)
return nil
}
func ensureProgressHeartbeat(ctx context.Context, clients *kube.Clients,
namespace string, nodeName string,
osu *monov1alpha1.OSUpgrade,