Skip to content

Commit c83df81

Browse files
authored
Merge pull request #12477 from sbueringer/pr-remove-redundant-check
🌱 Remove redundant check in verifyV1Beta2ConditionsTrueV1Beta1
2 parents 4e7f5d2 + 1b47eee commit c83df81

File tree

1 file changed

+10
-12
lines changed

1 file changed

+10
-12
lines changed

test/e2e/clusterctl_upgrade.go

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -832,19 +832,17 @@ func verifyV1Beta2ConditionsTrueV1Beta1(ctx context.Context, c client.Client, cl
832832
clusterv1.ClusterNameLabel: clusterName,
833833
})
834834
}, 3*time.Minute, 3*time.Second).Should(Succeed(), "Failed to list Machines for Cluster %s", klog.KObj(cluster))
835-
if cluster.Status.V1Beta2 != nil && len(cluster.Status.V1Beta2.Conditions) > 0 {
836-
for _, machine := range machineList.Items {
837-
if machine.Status.V1Beta2 == nil || len(machine.Status.V1Beta2.Conditions) == 0 {
838-
continue
839-
}
840-
for _, conditionType := range v1beta2conditionTypes {
841-
for _, condition := range machine.Status.V1Beta2.Conditions {
842-
if condition.Type != conditionType {
843-
continue
844-
}
845-
Expect(condition.Status).To(Equal(metav1.ConditionTrue), "The v1beta2 condition %q on the Machine %q should be set to true", conditionType, machine.Name)
846-
Expect(condition.Message).To(BeEmpty(), "The v1beta2 condition %q on the Machine %q should have an empty message", conditionType, machine.Name)
835+
for _, machine := range machineList.Items {
836+
if machine.Status.V1Beta2 == nil || len(machine.Status.V1Beta2.Conditions) == 0 {
837+
continue
838+
}
839+
for _, conditionType := range v1beta2conditionTypes {
840+
for _, condition := range machine.Status.V1Beta2.Conditions {
841+
if condition.Type != conditionType {
842+
continue
847843
}
844+
Expect(condition.Status).To(Equal(metav1.ConditionTrue), "The v1beta2 condition %q on the Machine %q should be set to true", conditionType, machine.Name)
845+
Expect(condition.Message).To(BeEmpty(), "The v1beta2 condition %q on the Machine %q should have an empty message", conditionType, machine.Name)
848846
}
849847
}
850848
}

0 commit comments

Comments
 (0)