Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[release-1.4] 🐛 test/e2e check for machines being ready after provisioning on Runtime SDK test #8646

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions test/e2e/cluster_upgrade_runtimesdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,30 @@ func clusterUpgradeWithRuntimeSDKSpec(ctx context.Context, inputGetter func() cl
clusterRef,
input.E2EConfig.GetIntervals(specName, "wait-cluster"))
},
PostMachinesProvisioned: func() {
Eventually(func() error {
// Before running the BeforeClusterUpgrade hook, the topology controller
// checks if the ControlPlane `IsScaling()` and for MachineDeployments if
// `IsAnyRollingOut()`.
// This PostMachineProvisioned function ensures that the clusters machines
// are healthy by checking the MachineNodeHealthyCondition, so the upgrade
// below does not get delayed or runs into timeouts before even reaching
// the BeforeClusterUpgrade hook.
machineList := &clusterv1.MachineList{}
if err := input.BootstrapClusterProxy.GetClient().List(ctx, machineList, client.InNamespace(namespace.Name)); err != nil {
return errors.Wrap(err, "list machines")
}

for i := range machineList.Items {
machine := &machineList.Items[i]
if !conditions.IsTrue(machine, clusterv1.MachineNodeHealthyCondition) {
return errors.Errorf("machine %q does not have %q condition set to true", machine.GetName(), clusterv1.MachineNodeHealthyCondition)
}
}

return nil
}, 5*time.Minute, 15*time.Second).Should(Succeed(), "Waiting for rollouts to finish")
},
WaitForClusterIntervals: input.E2EConfig.GetIntervals(specName, "wait-cluster"),
WaitForControlPlaneIntervals: input.E2EConfig.GetIntervals(specName, "wait-control-plane"),
WaitForMachineDeployments: input.E2EConfig.GetIntervals(specName, "wait-worker-nodes"),
Expand Down