From 7926dade29ec963b2948b932c6f959e030672df9 Mon Sep 17 00:00:00 2001 From: Salvatore Dario Minonne Date: Fri, 19 Jun 2026 14:19:24 +0200 Subject: [PATCH] fix(nodepool): don't explicitly set the MinReadySeconds default The upgrade test on release-4.22 has been 100% broken since PR #8594 (CAPI 1.11 upgrade) merged to main. The pre-upgrade operator image (hypershift/hypershift-operator:latest, built from main) no longer sets MinReadySeconds on MachineDeployments, but the post-upgrade release-4.22 operator unconditionally sets it to *int32(0). This causes a spec change (nil -> 0) on every MachineDeployment during reconciliation, bumping the generation and failing the upgrade invariant check. Remove the explicit MinReadySeconds defaulting from both MachineDeployment and MachineSet reconciliation, matching what #8594 already did on main. The CAPI controller applies its own defaults, making the explicit setting unnecessary. Co-Authored-By: Claude Opus 4.6 --- hypershift-operator/controllers/nodepool/capi.go | 6 ------ 1 file changed, 6 deletions(-) diff --git a/hypershift-operator/controllers/nodepool/capi.go b/hypershift-operator/controllers/nodepool/capi.go index 39917b81a22c..ea74e8784344 100644 --- a/hypershift-operator/controllers/nodepool/capi.go +++ b/hypershift-operator/controllers/nodepool/capi.go @@ -419,11 +419,6 @@ func (c *CAPI) reconcileMachineDeployment(ctx context.Context, log logr.Logger, } machineDeployment.Labels[capiv1.ClusterNameLabel] = capiClusterName - // Set defaults. These are normally set by the CAPI machinedeployment webhook. - // However, since we don't run the webhook, CAPI updates the machinedeployment - // after it has been created with defaults. - machineDeployment.Spec.MinReadySeconds = ptr.To[int32](0) - machineDeployment.Spec.ClusterName = capiClusterName if machineDeployment.Spec.Selector.MatchLabels == nil { machineDeployment.Spec.Selector.MatchLabels = map[string]string{} @@ -880,7 +875,6 @@ func (c *CAPI) reconcileMachineSet(ctx context.Context, machineSet.Labels[capiv1.ClusterNameLabel] = capiClusterName resourcesName := generateName(capiClusterName, nodePool.Spec.ClusterName, nodePool.GetName()) - machineSet.Spec.MinReadySeconds = int32(0) gvk, err := apiutil.GVKForObject(machineTemplateCR, api.Scheme) if err != nil {