Skip to content

Commit ad69e7c

Browse files
Fix E2E
1 parent 722f6c1 commit ad69e7c

File tree

1 file changed

+17
-13
lines changed

1 file changed

+17
-13
lines changed

test/e2e/clusterctl_upgrade.go

+17-13
Original file line numberDiff line numberDiff line change
@@ -813,13 +813,15 @@ func verifyV1Beta2ConditionsTrueV1Beta1(ctx context.Context, c client.Client, cl
813813
return c.Get(ctx, key, cluster)
814814
}, 3*time.Minute, 3*time.Second).Should(Succeed(), "Failed to get Cluster object %s", klog.KRef(clusterNamespace, clusterName))
815815

816-
for _, conditionType := range v1beta2conditionTypes {
817-
for _, condition := range cluster.Status.V1Beta2.Conditions {
818-
if condition.Type != conditionType {
819-
continue
816+
if cluster.Status.V1Beta2 != nil && cluster.Status.V1Beta2.Conditions == nil {
817+
for _, conditionType := range v1beta2conditionTypes {
818+
for _, condition := range cluster.Status.V1Beta2.Conditions {
819+
if condition.Type != conditionType {
820+
continue
821+
}
822+
Expect(condition.Status).To(Equal(metav1.ConditionTrue), "The v1beta2 condition %q on the Cluster should be set to true", conditionType)
823+
Expect(condition.Message).To(BeEmpty(), "The v1beta2 condition %q on the Cluster should have an empty message", conditionType)
820824
}
821-
Expect(condition.Status).To(Equal(metav1.ConditionTrue), "The v1beta2 condition %q on the Cluster should be set to true", conditionType)
822-
Expect(condition.Message).To(BeEmpty(), "The v1beta2 condition %q on the Cluster should have an empty message", conditionType)
823825
}
824826
}
825827

@@ -830,14 +832,16 @@ func verifyV1Beta2ConditionsTrueV1Beta1(ctx context.Context, c client.Client, cl
830832
clusterv1.ClusterNameLabel: clusterName,
831833
})
832834
}, 3*time.Minute, 3*time.Second).Should(Succeed(), "Failed to list Machines for Cluster %s", klog.KObj(cluster))
833-
for _, machine := range machineList.Items {
834-
for _, conditionType := range v1beta2conditionTypes {
835-
for _, condition := range machine.Status.V1Beta2.Conditions {
836-
if condition.Type != conditionType {
837-
continue
835+
if cluster.Status.V1Beta2 != nil && cluster.Status.V1Beta2.Conditions == nil {
836+
for _, machine := range machineList.Items {
837+
for _, conditionType := range v1beta2conditionTypes {
838+
for _, condition := range machine.Status.V1Beta2.Conditions {
839+
if condition.Type != conditionType {
840+
continue
841+
}
842+
Expect(condition.Status).To(Equal(metav1.ConditionTrue), "The v1beta2 condition %q on the Machine %q should be set to true", conditionType, machine.Name)
843+
Expect(condition.Message).To(BeEmpty(), "The v1beta2 condition %q on the Machine %q should have an empty message", conditionType, machine.Name)
838844
}
839-
Expect(condition.Status).To(Equal(metav1.ConditionTrue), "The v1beta2 condition %q on the Machine %q should be set to true", conditionType, machine.Name)
840-
Expect(condition.Message).To(BeEmpty(), "The v1beta2 condition %q on the Machine %q should have an empty message", conditionType, machine.Name)
841845
}
842846
}
843847
}

0 commit comments

Comments
 (0)