@@ -612,43 +612,42 @@ func ClusterctlUpgradeSpec(ctx context.Context, inputGetter func() ClusterctlUpg
612
612
input .PostUpgrade (managementClusterProxy , workloadClusterNamespace , managementClusterName )
613
613
}
614
614
615
- // After the upgrade check that MachineList is available. This ensures the APIServer is serving without
616
- // error before checking that it `Consistently` returns the MachineList later on.
617
- Byf ("[%d] Waiting for MachineList to be available" , i )
615
+ // After the upgrade: wait for MachineList to be available after the upgrade.
618
616
Eventually (func () error {
619
617
postUpgradeMachineList := & unstructured.UnstructuredList {}
620
618
postUpgradeMachineList .SetGroupVersionKind (schema.GroupVersionKind {
621
619
Group : clusterv1 .GroupVersion .Group ,
622
620
Version : coreCAPIStorageVersion ,
623
621
Kind : "MachineList" ,
624
622
})
625
- err = managementClusterProxy .GetClient ().List (
623
+ return managementClusterProxy .GetClient ().List (
626
624
ctx ,
627
625
postUpgradeMachineList ,
628
626
client .InNamespace (workloadCluster .GetNamespace ()),
629
627
client.MatchingLabels {clusterv1 .ClusterNameLabel : workloadCluster .GetName ()},
630
628
)
631
- return err
632
629
}, "3m" , "30s" ).ShouldNot (HaveOccurred (), "MachineList should be available after the upgrade" )
633
630
634
- // After the upgrade check that there were no unexpected rollouts.
635
- Byf ("[%d] Verify there are no unexpected rollouts" , i )
636
- Consistently (func () bool {
637
- postUpgradeMachineList := & unstructured.UnstructuredList {}
631
+ Byf ("[%d] Waiting for three minutes before checking if an unexpected rollout happened" , i )
632
+ time .Sleep (time .Minute * 3 )
633
+
634
+ // After the upgrade: check that there were no unexpected rollouts.
635
+ postUpgradeMachineList := & unstructured.UnstructuredList {}
636
+ Byf ("[%d] Verifing there are no unexpected rollouts" , i )
637
+ Eventually (func () error {
638
638
postUpgradeMachineList .SetGroupVersionKind (schema.GroupVersionKind {
639
639
Group : clusterv1 .GroupVersion .Group ,
640
640
Version : coreCAPIStorageVersion ,
641
641
Kind : "MachineList" ,
642
642
})
643
- err = managementClusterProxy .GetClient ().List (
643
+ return managementClusterProxy .GetClient ().List (
644
644
ctx ,
645
645
postUpgradeMachineList ,
646
646
client .InNamespace (workloadCluster .GetNamespace ()),
647
647
client.MatchingLabels {clusterv1 .ClusterNameLabel : workloadCluster .GetName ()},
648
648
)
649
- Expect (err ).ToNot (HaveOccurred ())
650
- return validateMachineRollout (preUpgradeMachineList , postUpgradeMachineList )
651
- }, "3m" , "30s" ).Should (BeTrue (), "Machines should remain the same after the upgrade" )
649
+ }, "3m" , "30s" ).ShouldNot (HaveOccurred (), "MachineList should be available after the upgrade" )
650
+ Expect (validateMachineRollout (preUpgradeMachineList , postUpgradeMachineList )).To (BeTrue (), "Machines should remain the same after the upgrade" )
652
651
653
652
// Scale up to 2 and back down to 1 so we can repeat this multiple times.
654
653
Byf ("[%d] Scale MachineDeployment to ensure the providers work" , i )
0 commit comments