@@ -813,7 +813,7 @@ 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- if cluster .Status .V1Beta2 != nil && cluster .Status .V1Beta2 .Conditions == nil {
816+ if cluster .Status .V1Beta2 != nil && len ( cluster .Status .V1Beta2 .Conditions ) > 0 {
817817 for _ , conditionType := range v1beta2conditionTypes {
818818 for _ , condition := range cluster .Status .V1Beta2 .Conditions {
819819 if condition .Type != conditionType {
@@ -832,8 +832,11 @@ 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 && cluster .Status .V1Beta2 .Conditions == nil {
835+ if cluster .Status .V1Beta2 != nil && len ( cluster .Status .V1Beta2 .Conditions ) > 0 {
836836 for _ , machine := range machineList .Items {
837+ if machine .Status .V1Beta2 == nil || len (machine .Status .V1Beta2 .Conditions ) == 0 {
838+ continue
839+ }
837840 for _ , conditionType := range v1beta2conditionTypes {
838841 for _ , condition := range machine .Status .V1Beta2 .Conditions {
839842 if condition .Type != conditionType {
0 commit comments