Skip to content

Commit

Permalink
Wait for md rollout after rebase
Browse files Browse the repository at this point in the history
Signed-off-by: Danil-Grigorev <[email protected]>
  • Loading branch information
Danil-Grigorev committed Jan 20, 2025
1 parent d2a4e3b commit aafeb5c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions test/e2e/clusterclass_changes.go
Original file line number Diff line number Diff line change
Expand Up @@ -790,10 +790,10 @@ func rebaseClusterClassAndWait(ctx context.Context, input rebaseClusterClassAndW
// NOTE: We only wait until the change is rolled out to the MachineDeployment objects and not to the worker machines
// to speed up the test and focus the test on the ClusterClass feature.
log.Logf("Waiting for MachineDeployment rollout for MachineDeploymentTopology %q (class %q) to complete.", mdTopology.Name, mdTopology.Class)
Eventually(func() error {
Eventually(func(g Gomega) error {
// Get MachineDeployment for the current MachineDeploymentTopology.
mdList := &clusterv1.MachineDeploymentList{}
Expect(mgmtClient.List(ctx, mdList, client.InNamespace(input.Cluster.Namespace), client.MatchingLabels{
g.Expect(mgmtClient.List(ctx, mdList, client.InNamespace(input.Cluster.Namespace), client.MatchingLabels{
clusterv1.ClusterTopologyMachineDeploymentNameLabel: mdTopology.Name,
})).To(Succeed())
if len(mdList.Items) != 1 {
Expand All @@ -810,6 +810,10 @@ func rebaseClusterClassAndWait(ctx context.Context, input rebaseClusterClassAndW
return errors.Errorf("label %q should be %q, but is %q", testWorkerLabelName, mdTopology.Class, labelValue)
}

g.Expect(md.Spec.Replicas).To(Equal(md.Status.Replicas), "Machine deployment does not have expected replicas")

Check failure on line 813 in test/e2e/clusterclass_changes.go

View workflow job for this annotation

GitHub Actions / lint (test)

ginkgo-linter: comparing a pointer to a value will always fail. Consider using `g.Expect(md.Spec.Replicas).To(HaveValue(Equal(md.Status.Replicas)), "Machine deployment does not have expected replicas")` instead (ginkgolinter)
g.Expect(md.Spec.Replicas).To(Equal(md.Status.AvailableReplicas), "Machine deployment does not have expected available replicas")

Check failure on line 814 in test/e2e/clusterclass_changes.go

View workflow job for this annotation

GitHub Actions / lint (test)

ginkgo-linter: comparing a pointer to a value will always fail. Consider using `g.Expect(md.Spec.Replicas).To(HaveValue(Equal(md.Status.AvailableReplicas)), "Machine deployment does not have expected available replicas")` instead (ginkgolinter)
g.Expect(md.Spec.Replicas).To(Equal(md.Status.ReadyReplicas), "Machine deployment does not have expected ready replicas")

Check failure on line 815 in test/e2e/clusterclass_changes.go

View workflow job for this annotation

GitHub Actions / lint (test)

ginkgo-linter: comparing a pointer to a value will always fail. Consider using `g.Expect(md.Spec.Replicas).To(HaveValue(Equal(md.Status.ReadyReplicas)), "Machine deployment does not have expected ready replicas")` instead (ginkgolinter)

return nil
}, input.WaitForMachineDeployments...).Should(BeNil())
}
Expand Down

0 comments on commit aafeb5c

Please sign in to comment.