Skip to content

Commit 7702621

Browse files
authored
Merge pull request #11411 from fabriziopandini/refine-v1beta2-condition-reasons
🌱 Refine v1beta2 condition reasons
2 parents c9654bb + 18d0cdc commit 7702621

23 files changed

+660
-279
lines changed

api/v1beta1/cluster_types.go

Lines changed: 51 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,16 @@ const (
4747
// If conditions are defined in spec.availabilityGates, those conditions must be true as well.
4848
ClusterAvailableV1Beta2Condition = AvailableV1Beta2Condition
4949

50+
// ClusterAvailableV1Beta2Reason surfaces when the cluster availability criteria is met.
51+
ClusterAvailableV1Beta2Reason = AvailableV1Beta2Reason
52+
53+
// ClusterNotAvailableV1Beta2Reason surfaces when the cluster availability criteria is not met (and thus the machine is not available).
54+
ClusterNotAvailableV1Beta2Reason = NotAvailableV1Beta2Reason
55+
56+
// ClusterAvailableUnknownV1Beta2Reason surfaces when at least one cluster availability criteria is unknown
57+
// and no availability criteria is not met.
58+
ClusterAvailableUnknownV1Beta2Reason = AvailableUnknownV1Beta2Reason
59+
5060
// ClusterAvailableInternalErrorV1Beta2Reason surfaces unexpected error when computing the Available condition.
5161
ClusterAvailableInternalErrorV1Beta2Reason = InternalErrorV1Beta2Reason
5262
)
@@ -186,6 +196,17 @@ const (
186196
// Note: Stand-alone MachineSets and stand-alone Machines are not included in this condition.
187197
ClusterWorkersAvailableV1Beta2Condition = "WorkersAvailable"
188198

199+
// ClusterWorkersAvailableV1Beta2Reason surfaces when all MachineDeployment and MachinePool's Available conditions are true.
200+
ClusterWorkersAvailableV1Beta2Reason = AvailableV1Beta2Reason
201+
202+
// ClusterWorkersNotAvailableV1Beta2Reason surfaces when at least one of the MachineDeployment and MachinePool's Available
203+
// conditions is false.
204+
ClusterWorkersNotAvailableV1Beta2Reason = NotAvailableV1Beta2Reason
205+
206+
// ClusterWorkersAvailableUnknownV1Beta2Reason surfaces when at least one of the MachineDeployment and MachinePool's Available
207+
// conditions is unknown and none of those Available conditions is false.
208+
ClusterWorkersAvailableUnknownV1Beta2Reason = AvailableUnknownV1Beta2Reason
209+
189210
// ClusterWorkersAvailableNoWorkersV1Beta2Reason surfaces when no MachineDeployment and MachinePool exist for the Cluster.
190211
ClusterWorkersAvailableNoWorkersV1Beta2Reason = "NoWorkers"
191212

@@ -199,6 +220,16 @@ const (
199220
// ClusterMachinesReadyV1Beta2Condition surfaces detail of issues on the controlled machines, if any.
200221
ClusterMachinesReadyV1Beta2Condition = MachinesReadyV1Beta2Condition
201222

223+
// ClusterMachinesReadyV1Beta2Reason surfaces when all the controlled machine's Ready conditions are true.
224+
ClusterMachinesReadyV1Beta2Reason = ReadyV1Beta2Reason
225+
226+
// ClusterMachinesNotReadyV1Beta2Reason surfaces when at least one of the controlled machine's Ready conditions is false.
227+
ClusterMachinesNotReadyV1Beta2Reason = NotReadyV1Beta2Reason
228+
229+
// ClusterMachinesReadyUnknownV1Beta2Reason surfaces when at least one of the controlled machine's Ready conditions is unknown
230+
// and none of the controlled machine's Ready conditions is false.
231+
ClusterMachinesReadyUnknownV1Beta2Reason = ReadyUnknownV1Beta2Reason
232+
202233
// ClusterMachinesReadyNoReplicasV1Beta2Reason surfaces when no machines exist for the Cluster.
203234
ClusterMachinesReadyNoReplicasV1Beta2Reason = NoReplicasV1Beta2Reason
204235

@@ -212,6 +243,16 @@ const (
212243
// ClusterMachinesUpToDateV1Beta2Condition surfaces details of Cluster's machines not up to date, if any.
213244
ClusterMachinesUpToDateV1Beta2Condition = MachinesUpToDateV1Beta2Condition
214245

246+
// ClusterMachinesUpToDateV1Beta2Reason surfaces when all the controlled machine's UpToDate conditions are true.
247+
ClusterMachinesUpToDateV1Beta2Reason = UpToDateV1Beta2Reason
248+
249+
// ClusterMachinesNotUpToDateV1Beta2Reason surfaces when at least one of the controlled machine's UpToDate conditions is false.
250+
ClusterMachinesNotUpToDateV1Beta2Reason = NotUpToDateV1Beta2Reason
251+
252+
// ClusterMachinesUpToDateUnknownV1Beta2Reason surfaces when at least one of the controlled machine's UpToDate conditions is unknown
253+
// and none of the controlled machine's UpToDate conditions is false.
254+
ClusterMachinesUpToDateUnknownV1Beta2Reason = UpToDateUnknownV1Beta2Reason
255+
215256
// ClusterMachinesUpToDateNoReplicasV1Beta2Reason surfaces when no machines exist for the Cluster.
216257
ClusterMachinesUpToDateNoReplicasV1Beta2Reason = NoReplicasV1Beta2Reason
217258

@@ -244,10 +285,14 @@ const (
244285
// MachinePools and stand-alone MachineSets are scaling up.
245286
ClusterScalingUpV1Beta2Reason = ScalingUpV1Beta2Reason
246287

247-
// ClusterNotScalingUpV1Beta2Reason surfaces when no one of the Cluster's control plane, MachineDeployments,
288+
// ClusterNotScalingUpV1Beta2Reason surfaces when none of the Cluster's control plane, MachineDeployments,
248289
// MachinePools and stand-alone MachineSets are scaling up.
249290
ClusterNotScalingUpV1Beta2Reason = NotScalingUpV1Beta2Reason
250291

292+
// ClusterScalingUpUnknownV1Beta2Reason surfaces when one of the Cluster's control plane, MachineDeployments,
293+
// MachinePools and stand-alone MachineSets scaling up condition is unknown, and none true.
294+
ClusterScalingUpUnknownV1Beta2Reason = "ScalingUpUnknown"
295+
251296
// ClusterScalingUpInternalErrorV1Beta2Reason surfaces unexpected failures when listing machines
252297
// or computing the ScalingUp condition.
253298
ClusterScalingUpInternalErrorV1Beta2Reason = InternalErrorV1Beta2Reason
@@ -263,10 +308,14 @@ const (
263308
// MachinePools and stand-alone MachineSets are scaling down.
264309
ClusterScalingDownV1Beta2Reason = ScalingDownV1Beta2Reason
265310

266-
// ClusterNotScalingDownV1Beta2Reason surfaces when no one of the Cluster's control plane, MachineDeployments,
311+
// ClusterNotScalingDownV1Beta2Reason surfaces when none of the Cluster's control plane, MachineDeployments,
267312
// MachinePools and stand-alone MachineSets are scaling down.
268313
ClusterNotScalingDownV1Beta2Reason = NotScalingUpV1Beta2Reason
269314

315+
// ClusterScalingDownUnknownV1Beta2Reason surfaces when one of the Cluster's control plane, MachineDeployments,
316+
// MachinePools and stand-alone MachineSets scaling down condition is unknown, and none true.
317+
ClusterScalingDownUnknownV1Beta2Reason = "ScalingDownUnknown"
318+
270319
// ClusterScalingDownInternalErrorV1Beta2Reason surfaces unexpected failures when listing machines
271320
// or computing the ScalingDown condition.
272321
ClusterScalingDownInternalErrorV1Beta2Reason = InternalErrorV1Beta2Reason

api/v1beta1/machine_types.go

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,6 @@ const (
9292
// Note: MinReadySeconds is assumed 0 until it will be implemented in v1beta2 API.
9393
MachineAvailableV1Beta2Condition = AvailableV1Beta2Condition
9494

95-
// MachineNotReadyV1Beta2Reason surfaces when a machine is not ready (and thus not available).
96-
MachineNotReadyV1Beta2Reason = "NotReady"
97-
9895
// MachineWaitingForMinReadySecondsV1Beta2Reason surfaces when a machine is ready for less than MinReadySeconds (and thus not yet available).
9996
MachineWaitingForMinReadySecondsV1Beta2Reason = "WaitingForMinReadySeconds"
10097

@@ -114,6 +111,17 @@ const (
114111
// these conditions must be true as well.
115112
MachineReadyV1Beta2Condition = ReadyV1Beta2Condition
116113

114+
// MachineReadyV1Beta2Reason surfaces when the machine readiness criteria is met.
115+
MachineReadyV1Beta2Reason = ReadyV1Beta2Reason
116+
117+
// MachineNotReadyV1Beta2Reason surfaces when the machine readiness criteria is not met.
118+
// Note: when a machine is not ready, it is also not available.
119+
MachineNotReadyV1Beta2Reason = NotReadyV1Beta2Reason
120+
121+
// MachineReadyUnknownV1Beta2Reason surfaces when at least one machine readiness criteria is unknown
122+
// and no machine readiness criteria is not met.
123+
MachineReadyUnknownV1Beta2Reason = ReadyUnknownV1Beta2Reason
124+
117125
// MachineReadyInternalErrorV1Beta2Reason surfaces unexpected error when computing the Ready condition.
118126
MachineReadyInternalErrorV1Beta2Reason = InternalErrorV1Beta2Reason
119127
)
@@ -199,8 +207,24 @@ const (
199207
// MachineNodeReadyV1Beta2Condition is true if the Machine's Node is ready.
200208
MachineNodeReadyV1Beta2Condition = "NodeReady"
201209

202-
// MachineNodeConditionNotYetReportedV1Beta2Reason surfaces when a Machine's Node doesn't have a condition reported yet.
203-
MachineNodeConditionNotYetReportedV1Beta2Reason = "NodeConditionNotYetReported"
210+
// MachineNodeReadyV1Beta2Reason surfaces when Machine's Node Ready condition is true.
211+
MachineNodeReadyV1Beta2Reason = "NodeReady"
212+
213+
// MachineNodeNotReadyV1Beta2Reason surfaces when Machine's Node Ready condition is false.
214+
MachineNodeNotReadyV1Beta2Reason = "NodeNotReady"
215+
216+
// MachineNodeReadyUnknownV1Beta2Reason surfaces when Machine's Node Ready condition is unknown.
217+
MachineNodeReadyUnknownV1Beta2Reason = "NodeReadyUnknown"
218+
219+
// MachineNodeHealthyV1Beta2Reason surfaces when all the node conditions report healthy state.
220+
MachineNodeHealthyV1Beta2Reason = "NodeHealthy"
221+
222+
// MachineNodeNotHealthyV1Beta2Reason surfaces when at least one node conditions report not healthy state.
223+
MachineNodeNotHealthyV1Beta2Reason = "NodeNotHealthy"
224+
225+
// MachineNodeHealthUnknownV1Beta2Reason surfaces when at least one node conditions report healthy state unknown
226+
// and no node conditions report not healthy state.
227+
MachineNodeHealthUnknownV1Beta2Reason = "NodeHealthyUnknown"
204228

205229
// MachineNodeInternalErrorV1Beta2Reason surfaces unexpected failures when reading a Node object.
206230
MachineNodeInternalErrorV1Beta2Reason = InternalErrorV1Beta2Reason

api/v1beta1/machinedeployment_types.go

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,16 @@ const (
107107
// MachineDeploymentMachinesReadyV1Beta2Condition surfaces detail of issues on the controlled machines, if any.
108108
MachineDeploymentMachinesReadyV1Beta2Condition = MachinesReadyV1Beta2Condition
109109

110+
// MachineDeploymentMachinesReadyV1Beta2Reason surfaces when all the controlled machine's Ready conditions are true.
111+
MachineDeploymentMachinesReadyV1Beta2Reason = ReadyV1Beta2Reason
112+
113+
// MachineDeploymentMachinesNotReadyV1Beta2Reason surfaces when at least one of the controlled machine's Ready conditions is false.
114+
MachineDeploymentMachinesNotReadyV1Beta2Reason = NotReadyV1Beta2Reason
115+
116+
// MachineDeploymentMachinesReadyUnknownV1Beta2Reason surfaces when at least one of the controlled machine's Ready conditions is unknown
117+
// and none of the controlled machine's Ready conditions is false.
118+
MachineDeploymentMachinesReadyUnknownV1Beta2Reason = ReadyUnknownV1Beta2Reason
119+
110120
// MachineDeploymentMachinesReadyNoReplicasV1Beta2Reason surfaces when no machines exist for the MachineDeployment.
111121
MachineDeploymentMachinesReadyNoReplicasV1Beta2Reason = NoReplicasV1Beta2Reason
112122

@@ -120,6 +130,16 @@ const (
120130
// MachineDeploymentMachinesUpToDateV1Beta2Condition surfaces details of controlled machines not up to date, if any.
121131
MachineDeploymentMachinesUpToDateV1Beta2Condition = MachinesUpToDateV1Beta2Condition
122132

133+
// MachineDeploymentMachinesUpToDateV1Beta2Reason surfaces when all the controlled machine's UpToDate conditions are true.
134+
MachineDeploymentMachinesUpToDateV1Beta2Reason = UpToDateV1Beta2Reason
135+
136+
// MachineDeploymentMachinesNotUpToDateV1Beta2Reason surfaces when at least one of the controlled machine's UpToDate conditions is false.
137+
MachineDeploymentMachinesNotUpToDateV1Beta2Reason = NotUpToDateV1Beta2Reason
138+
139+
// MachineDeploymentMachinesUpToDateUnknownV1Beta2Reason surfaces when at least one of the controlled machine's UpToDate conditions is unknown
140+
// and none of the controlled machine's UpToDate conditions is false.
141+
MachineDeploymentMachinesUpToDateUnknownV1Beta2Reason = UpToDateUnknownV1Beta2Reason
142+
123143
// MachineDeploymentMachinesUpToDateNoReplicasV1Beta2Reason surfaces when no machines exist for the MachineDeployment.
124144
MachineDeploymentMachinesUpToDateNoReplicasV1Beta2Reason = NoReplicasV1Beta2Reason
125145

api/v1beta1/machineset_types.go

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,16 @@ const (
131131
// MachineSetMachinesReadyV1Beta2Condition surfaces detail of issues on the controlled machines, if any.
132132
MachineSetMachinesReadyV1Beta2Condition = MachinesReadyV1Beta2Condition
133133

134+
// MachineSetMachinesReadyV1Beta2Reason surfaces when all the controlled machine's Ready conditions are true.
135+
MachineSetMachinesReadyV1Beta2Reason = ReadyV1Beta2Reason
136+
137+
// MachineSetMachinesNotReadyV1Beta2Reason surfaces when at least one of the controlled machine's Ready conditions is false.
138+
MachineSetMachinesNotReadyV1Beta2Reason = NotReadyV1Beta2Reason
139+
140+
// MachineSetMachinesReadyUnknownV1Beta2Reason surfaces when at least one of the controlled machine's Ready conditions is unknown
141+
// and none of the controlled machine's Ready conditions is false.
142+
MachineSetMachinesReadyUnknownV1Beta2Reason = ReadyUnknownV1Beta2Reason
143+
134144
// MachineSetMachinesReadyNoReplicasV1Beta2Reason surfaces when no machines exist for the MachineSet.
135145
MachineSetMachinesReadyNoReplicasV1Beta2Reason = NoReplicasV1Beta2Reason
136146

@@ -145,6 +155,16 @@ const (
145155
// MachineSetMachinesUpToDateV1Beta2Condition surfaces details of controlled machines not up to date, if any.
146156
MachineSetMachinesUpToDateV1Beta2Condition = MachinesUpToDateV1Beta2Condition
147157

158+
// MachineSetMachinesUpToDateV1Beta2Reason surfaces when all the controlled machine's UpToDate conditions are true.
159+
MachineSetMachinesUpToDateV1Beta2Reason = UpToDateV1Beta2Reason
160+
161+
// MachineSetMachinesNotUpToDateV1Beta2Reason surfaces when at least one of the controlled machine's UpToDate conditions is false.
162+
MachineSetMachinesNotUpToDateV1Beta2Reason = NotUpToDateV1Beta2Reason
163+
164+
// MachineSetMachinesUpToDateUnknownV1Beta2Reason surfaces when at least one of the controlled machine's UpToDate conditions is unknown
165+
// and none of the controlled machine's UpToDate conditions is false.
166+
MachineSetMachinesUpToDateUnknownV1Beta2Reason = UpToDateUnknownV1Beta2Reason
167+
148168
// MachineSetMachinesUpToDateNoReplicasV1Beta2Reason surfaces when no machines exist for the MachineSet.
149169
MachineSetMachinesUpToDateNoReplicasV1Beta2Reason = NoReplicasV1Beta2Reason
150170

api/v1beta1/v1beta2_condition_consts.go

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,27 @@ const (
9393
// NotAvailableV1Beta2Reason applies to a condition surfacing object not satisfying availability criteria.
9494
NotAvailableV1Beta2Reason = "NotAvailable"
9595

96+
// AvailableUnknownV1Beta2Reason applies to a condition surfacing object availability unknown.
97+
AvailableUnknownV1Beta2Reason = "AvailableUnknown"
98+
99+
// ReadyV1Beta2Reason applies to a condition surfacing object readiness.
100+
ReadyV1Beta2Reason = "Ready"
101+
102+
// NotReadyV1Beta2Reason applies to a condition surfacing object not satisfying readiness criteria.
103+
NotReadyV1Beta2Reason = "NotReady"
104+
105+
// ReadyUnknownV1Beta2Reason applies to a condition surfacing object readiness unknown.
106+
ReadyUnknownV1Beta2Reason = "ReadyUnknown"
107+
108+
// UpToDateV1Beta2Reason applies to a condition surfacing object up-tp-date.
109+
UpToDateV1Beta2Reason = "UpToDate"
110+
111+
// NotUpToDateV1Beta2Reason applies to a condition surfacing object not up-tp-date.
112+
NotUpToDateV1Beta2Reason = "NotUpToDate"
113+
114+
// UpToDateUnknownV1Beta2Reason applies to a condition surfacing object up-tp-date unknown.
115+
UpToDateUnknownV1Beta2Reason = "UpToDateUnknown"
116+
96117
// ScalingUpV1Beta2Reason surfaces when an object is scaling up.
97118
ScalingUpV1Beta2Reason = "ScalingUp"
98119

controlplane/kubeadm/api/v1beta1/v1beta2_condition_consts.go

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,16 @@ const (
137137
// If not using an external etcd also EtcdPodHealthy, EtcdMemberHealthy conditions are included.
138138
KubeadmControlPlaneMachinesReadyV1Beta2Condition = clusterv1.MachinesReadyV1Beta2Condition
139139

140+
// KubeadmControlPlaneMachinesReadyV1Beta2Reason surfaces when all the controlled machine's Ready conditions are true.
141+
KubeadmControlPlaneMachinesReadyV1Beta2Reason = clusterv1.ReadyV1Beta2Reason
142+
143+
// KubeadmControlPlaneMachinesNotReadyV1Beta2Reason surfaces when at least one of the controlled machine's Ready conditions is false.
144+
KubeadmControlPlaneMachinesNotReadyV1Beta2Reason = clusterv1.NotReadyV1Beta2Reason
145+
146+
// KubeadmControlPlaneMachinesReadyUnknownV1Beta2Reason surfaces when at least one of the controlled machine's Ready conditions is unknown
147+
// and no one of the controlled machine's Ready conditions is false.
148+
KubeadmControlPlaneMachinesReadyUnknownV1Beta2Reason = clusterv1.ReadyUnknownV1Beta2Reason
149+
140150
// KubeadmControlPlaneMachinesReadyNoReplicasV1Beta2Reason surfaces when no machines exist for the KubeadmControlPlane.
141151
KubeadmControlPlaneMachinesReadyNoReplicasV1Beta2Reason = clusterv1.NoReplicasV1Beta2Reason
142152

@@ -149,6 +159,16 @@ const (
149159
// KubeadmControlPlaneMachinesUpToDateV1Beta2Condition surfaces details of controlled machines not up to date, if any.
150160
KubeadmControlPlaneMachinesUpToDateV1Beta2Condition = clusterv1.MachinesUpToDateV1Beta2Condition
151161

162+
// KubeadmControlPlaneMachinesUpToDateV1Beta2Reason surfaces when all the controlled machine's UpToDate conditions are true.
163+
KubeadmControlPlaneMachinesUpToDateV1Beta2Reason = clusterv1.UpToDateV1Beta2Reason
164+
165+
// KubeadmControlPlaneMachinesNotUpToDateV1Beta2Reason surfaces when at least one of the controlled machine's UpToDate conditions is false.
166+
KubeadmControlPlaneMachinesNotUpToDateV1Beta2Reason = clusterv1.NotUpToDateV1Beta2Reason
167+
168+
// KubeadmControlPlaneMachinesUpToDateUnknownV1Beta2Reason surfaces when at least one of the controlled machine's UpToDate conditions is unknown
169+
// and no one of the controlled machine's UpToDate conditions is false.
170+
KubeadmControlPlaneMachinesUpToDateUnknownV1Beta2Reason = clusterv1.UpToDateUnknownV1Beta2Reason
171+
152172
// KubeadmControlPlaneMachinesUpToDateNoReplicasV1Beta2Reason surfaces when no machines exist for the KubeadmControlPlane.
153173
KubeadmControlPlaneMachinesUpToDateNoReplicasV1Beta2Reason = clusterv1.NoReplicasV1Beta2Reason
154174

controlplane/kubeadm/internal/controllers/status.go

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,16 @@ func setMachinesReadyCondition(ctx context.Context, kcp *controlplanev1.KubeadmC
330330
readyCondition, err := v1beta2conditions.NewAggregateCondition(
331331
machines.UnsortedList(), clusterv1.MachineReadyV1Beta2Condition,
332332
v1beta2conditions.TargetConditionType(controlplanev1.KubeadmControlPlaneMachinesReadyV1Beta2Condition),
333+
// Using a custom merge strategy to override reasons applied during merge.
334+
v1beta2conditions.CustomMergeStrategy{
335+
MergeStrategy: v1beta2conditions.DefaultMergeStrategy(
336+
v1beta2conditions.ComputeReasonFunc(v1beta2conditions.GetDefaultComputeMergeReasonFunc(
337+
controlplanev1.KubeadmControlPlaneMachinesNotReadyV1Beta2Reason,
338+
controlplanev1.KubeadmControlPlaneMachinesReadyUnknownV1Beta2Reason,
339+
controlplanev1.KubeadmControlPlaneMachinesReadyV1Beta2Reason,
340+
)),
341+
),
342+
},
333343
)
334344
if err != nil {
335345
v1beta2conditions.Set(kcp, metav1.Condition{
@@ -360,6 +370,16 @@ func setMachinesUpToDateCondition(ctx context.Context, kcp *controlplanev1.Kubea
360370
upToDateCondition, err := v1beta2conditions.NewAggregateCondition(
361371
machines.UnsortedList(), clusterv1.MachineUpToDateV1Beta2Condition,
362372
v1beta2conditions.TargetConditionType(controlplanev1.KubeadmControlPlaneMachinesUpToDateV1Beta2Condition),
373+
// Using a custom merge strategy to override reasons applied during merge.
374+
v1beta2conditions.CustomMergeStrategy{
375+
MergeStrategy: v1beta2conditions.DefaultMergeStrategy(
376+
v1beta2conditions.ComputeReasonFunc(v1beta2conditions.GetDefaultComputeMergeReasonFunc(
377+
controlplanev1.KubeadmControlPlaneMachinesNotUpToDateV1Beta2Reason,
378+
controlplanev1.KubeadmControlPlaneMachinesUpToDateUnknownV1Beta2Reason,
379+
controlplanev1.KubeadmControlPlaneMachinesUpToDateV1Beta2Reason,
380+
)),
381+
),
382+
},
363383
)
364384
if err != nil {
365385
v1beta2conditions.Set(kcp, metav1.Condition{
@@ -399,6 +419,8 @@ func setRemediatingCondition(ctx context.Context, kcp *controlplanev1.KubeadmCon
399419
remediatingCondition, err := v1beta2conditions.NewAggregateCondition(
400420
machinesToBeRemediated.UnsortedList(), clusterv1.MachineOwnerRemediatedV1Beta2Condition,
401421
v1beta2conditions.TargetConditionType(controlplanev1.KubeadmControlPlaneRemediatingV1Beta2Condition),
422+
// Note: in case of the remediating conditions it is not required to use a CustomMergeStrategy/ComputeReasonFunc
423+
// because we are considering only machinesToBeRemediated (and we can pin the reason when we set the condition).
402424
)
403425
if err != nil {
404426
v1beta2conditions.Set(kcp, metav1.Condition{

0 commit comments

Comments
 (0)