@@ -791,15 +791,6 @@ func setRollingOutCondition(ctx context.Context, cluster *clusterv1.Cluster, con
791
791
return
792
792
}
793
793
794
- if controlPlane == nil && len (machinePools .Items )+ len (machineDeployments .Items ) == 0 {
795
- v1beta2conditions .Set (cluster , metav1.Condition {
796
- Type : clusterv1 .ClusterRollingOutV1Beta2Condition ,
797
- Status : metav1 .ConditionFalse ,
798
- Reason : clusterv1 .ClusterNotRollingOutV1Beta2Reason ,
799
- })
800
- return
801
- }
802
-
803
794
ws := make ([]aggregationWrapper , 0 , len (machinePools .Items )+ len (machineDeployments .Items )+ 1 )
804
795
if controlPlane != nil {
805
796
// control plane is considered only if it is reporting the condition (the contract does not require conditions to be reported)
@@ -815,6 +806,15 @@ func setRollingOutCondition(ctx context.Context, cluster *clusterv1.Cluster, con
815
806
ws = append (ws , aggregationWrapper {md : & md })
816
807
}
817
808
809
+ if len (ws ) == 0 {
810
+ v1beta2conditions .Set (cluster , metav1.Condition {
811
+ Type : clusterv1 .ClusterRollingOutV1Beta2Condition ,
812
+ Status : metav1 .ConditionFalse ,
813
+ Reason : clusterv1 .ClusterNotRollingOutV1Beta2Reason ,
814
+ })
815
+ return
816
+ }
817
+
818
818
rollingOutCondition , err := v1beta2conditions .NewAggregateCondition (
819
819
ws , clusterv1 .RollingOutV1Beta2Condition ,
820
820
v1beta2conditions .TargetConditionType (clusterv1 .ClusterRollingOutV1Beta2Condition ),
@@ -862,15 +862,6 @@ func setScalingUpCondition(ctx context.Context, cluster *clusterv1.Cluster, cont
862
862
return
863
863
}
864
864
865
- if controlPlane == nil && len (machinePools .Items )+ len (machineDeployments .Items ) == 0 {
866
- v1beta2conditions .Set (cluster , metav1.Condition {
867
- Type : clusterv1 .ClusterScalingUpV1Beta2Condition ,
868
- Status : metav1 .ConditionFalse ,
869
- Reason : clusterv1 .ClusterNotScalingUpV1Beta2Reason ,
870
- })
871
- return
872
- }
873
-
874
865
ws := make ([]aggregationWrapper , 0 , len (machinePools .Items )+ len (machineDeployments .Items )+ 1 )
875
866
if controlPlane != nil {
876
867
// control plane is considered only if it is reporting the condition (the contract does not require conditions to be reported)
@@ -892,6 +883,15 @@ func setScalingUpCondition(ctx context.Context, cluster *clusterv1.Cluster, cont
892
883
ws = append (ws , aggregationWrapper {ms : & ms })
893
884
}
894
885
886
+ if len (ws ) == 0 {
887
+ v1beta2conditions .Set (cluster , metav1.Condition {
888
+ Type : clusterv1 .ClusterScalingUpV1Beta2Condition ,
889
+ Status : metav1 .ConditionFalse ,
890
+ Reason : clusterv1 .ClusterNotScalingUpV1Beta2Reason ,
891
+ })
892
+ return
893
+ }
894
+
895
895
scalingUpCondition , err := v1beta2conditions .NewAggregateCondition (
896
896
ws , clusterv1 .ScalingUpV1Beta2Condition ,
897
897
v1beta2conditions .TargetConditionType (clusterv1 .ClusterScalingUpV1Beta2Condition ),
@@ -939,15 +939,6 @@ func setScalingDownCondition(ctx context.Context, cluster *clusterv1.Cluster, co
939
939
return
940
940
}
941
941
942
- if controlPlane == nil && len (machinePools .Items )+ len (machineDeployments .Items ) == 0 {
943
- v1beta2conditions .Set (cluster , metav1.Condition {
944
- Type : clusterv1 .ClusterScalingDownV1Beta2Condition ,
945
- Status : metav1 .ConditionFalse ,
946
- Reason : clusterv1 .ClusterNotScalingDownV1Beta2Reason ,
947
- })
948
- return
949
- }
950
-
951
942
ws := make ([]aggregationWrapper , 0 , len (machinePools .Items )+ len (machineDeployments .Items )+ 1 )
952
943
if controlPlane != nil {
953
944
// control plane is considered only if it is reporting the condition (the contract does not require conditions to be reported)
@@ -969,6 +960,15 @@ func setScalingDownCondition(ctx context.Context, cluster *clusterv1.Cluster, co
969
960
ws = append (ws , aggregationWrapper {ms : & ms })
970
961
}
971
962
963
+ if len (ws ) == 0 {
964
+ v1beta2conditions .Set (cluster , metav1.Condition {
965
+ Type : clusterv1 .ClusterScalingDownV1Beta2Condition ,
966
+ Status : metav1 .ConditionFalse ,
967
+ Reason : clusterv1 .ClusterNotScalingDownV1Beta2Reason ,
968
+ })
969
+ return
970
+ }
971
+
972
972
scalingDownCondition , err := v1beta2conditions .NewAggregateCondition (
973
973
ws , clusterv1 .ScalingDownV1Beta2Condition ,
974
974
v1beta2conditions .TargetConditionType (clusterv1 .ClusterScalingDownV1Beta2Condition ),
0 commit comments