You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
🌱 test: add PreWaitForControlplaneToBeUpgraded to ClusterUpgradeConformanceSpec (kubernetes-sigs#11145)
* test: add PreWaitForControlplaneToBeUpgraded to ClusterUpgradeConformanceSpec
* test: add template for kcp-pre-drain
* test: adjust multi-controlplane quickstart test to check for all nodes and kube-proxy being healthy via a pre-drain hook
* lint fix
* Review fixes
* review fixes
* review fixes
* review fix
errList=append(errList, errors.Errorf("expected the Ready condition for Node %s to be true but got %s instead: %s", node.GetName(), condition.Status, condition.Message))
148
+
}
149
+
}
150
+
}
151
+
152
+
// Check if the expected number of kube-proxy pods exist and all of them are healthy for all existing Nodes of the Cluster.
errList=append(errList, errors.Errorf("expected the Ready condition for Pod %s to be true but got %s instead: %s", pod.GetName(), condition.Status, condition.Message))
160
+
}
161
+
}
162
+
}
163
+
164
+
iferr:=kerrors.NewAggregate(errList); err!=nil {
165
+
return0, errors.Wrap(err, "blocking upgrade because cluster is not stable")
166
+
}
167
+
168
+
// At this stage all current machines are considered ok, so remove the pre-drain webhook from a CP to unblock the next step of the upgrade.
169
+
iflen(deletingMachines) >0 {
170
+
iflen(deletingMachines) >1 {
171
+
return0, errors.Errorf("expected a maximum of 1 machine to be in deleting but got %d", len(deletingMachines))
172
+
}
173
+
174
+
m:=&deletingMachines[0]
175
+
176
+
ifm.Annotations[preDrainHook] !="true" {
177
+
return0, errors.Errorf("machine %s is in deletion but does not have pre-drain hook %q", klog.KObj(m), preDrainHook)
return0, errors.Errorf("deletion of Machine %s was blocked by pre-drain hook", klog.KObj(m))
193
+
}
194
+
195
+
ifint64(len(machines)) >upgradedAndHealthy {
196
+
return0, errors.New("old Machines remain")
197
+
}
198
+
199
+
returnupgradedAndHealthy, nil
200
+
}, e2eConfig.GetIntervals("k8s-upgrade-and-conformance", "wait-machine-upgrade")...).Should(Equal(controlPlaneMachineCount), "Timed out waiting for all control-plane machines in Cluster %s to be upgraded to kubernetes version %s", klog.KObj(cluster), cluster.Spec.Topology.Version)
}, retryableOperationTimeout, retryableOperationInterval).Should(Succeed(), "Failed to patch the new kubernetes version to KCP %s", klog.KObj(input.ControlPlane))
359
360
361
+
// Once we have patched the Kubernetes Cluster we can run PreWaitForControlPlaneToBeUpgraded.
0 commit comments