@@ -48,17 +48,20 @@ func (r *Reconciler) reconcileStatus(_ context.Context, s *scope) {
48
48
// Conditions
49
49
50
50
// MachinesReady
51
- if err := v1beta2conditions .SetAggregateCondition ( s . machines , s . machineSet ,
52
- clusterv1 .MachineReadyV1Beta2Condition ,
53
- v1beta2conditions .TargetConditionType (clusterv1 .MachineSetMachinesReadyV1Beta2Condition ),
54
- ); err != nil {
51
+ readyCondition , err := v1beta2conditions .NewAggregateCondition (
52
+ s . machines , clusterv1 .MachineReadyV1Beta2Condition ,
53
+ v1beta2conditions .TargetConditionType (clusterv1 .MachineSetMachinesReadyV1Beta2Condition ))
54
+ if err != nil {
55
55
v1beta2conditions .Set (s .machineSet , metav1.Condition {
56
56
Type : clusterv1 .MachineSetMachinesReadyV1Beta2Condition ,
57
57
Status : metav1 .ConditionFalse ,
58
58
Reason : "TODOFailedDuringAggregation" ,
59
59
Message : "something TODO at MachinesReady" ,
60
60
})
61
+ } else if readyCondition .Status == metav1 .ConditionTrue {
62
+ readyCondition .Message = "All Machines are ready."
61
63
}
64
+ v1beta2conditions .Set (s .machineSet , * readyCondition )
62
65
63
66
// MachinesUpToDate
64
67
if err := v1beta2conditions .SetAggregateCondition (s .machines , s .machineSet ,
@@ -126,9 +129,10 @@ func setScalingUpCondition(ms *clusterv1.MachineSet, machines []*clusterv1.Machi
126
129
}
127
130
128
131
v1beta2conditions .Set (ms , metav1.Condition {
129
- Type : clusterv1 .MachineSetScalingUpV1Beta2Condition ,
130
- Status : metav1 .ConditionFalse ,
131
- Reason : "NotScalingUp" , // TODO: create a const.
132
+ Type : clusterv1 .MachineSetScalingUpV1Beta2Condition ,
133
+ Status : metav1 .ConditionFalse ,
134
+ Reason : "NotScalingUp" , // TODO: create a const.
135
+ Message : "MachineSet is not scaling up" ,
132
136
})
133
137
}
134
138
@@ -150,9 +154,10 @@ func setScalingDownCondition(ms *clusterv1.MachineSet, machines []*clusterv1.Mac
150
154
151
155
if int32 (len (machines )) <= (desiredReplicas ) {
152
156
v1beta2conditions .Set (ms , metav1.Condition {
153
- Type : clusterv1 .MachineSetScalingDownV1Beta2Condition ,
154
- Status : metav1 .ConditionFalse ,
155
- Reason : "NotScalingDown" , // TODO: create a const.
157
+ Type : clusterv1 .MachineSetScalingDownV1Beta2Condition ,
158
+ Status : metav1 .ConditionFalse ,
159
+ Reason : "NotScalingDown" , // TODO: create a const.
160
+ Message : "MachineSet is not scaling down" ,
156
161
})
157
162
return
158
163
}
0 commit comments