Drafting ctl controller
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user