Skip to content

Commit 8493f4e

Browse files
committed
cluster: split MachinesReady and MachinesUpToDate for ControlPlane and Worker
1 parent 6865cec commit 8493f4e

File tree

5 files changed

+465
-150
lines changed

5 files changed

+465
-150
lines changed

api/v1beta1/cluster_types.go

+75-29
Original file line numberDiff line numberDiff line change
@@ -221,50 +221,96 @@ const (
221221
ClusterWorkersAvailableInternalErrorV1Beta2Reason = InternalErrorV1Beta2Reason
222222
)
223223

224-
// Cluster's MachinesReady condition and corresponding reasons that will be used in v1Beta2 API version.
224+
// Cluster's ControlPlaneMachinesReady condition and corresponding reasons that will be used in v1Beta2 API version.
225225
const (
226-
// ClusterMachinesReadyV1Beta2Condition surfaces detail of issues on the controlled machines, if any.
227-
ClusterMachinesReadyV1Beta2Condition = MachinesReadyV1Beta2Condition
226+
// ClusterControlPlaneMachinesReadyV1Beta2Condition surfaces detail of issues on control plane machines, if any.
227+
ClusterControlPlaneMachinesReadyV1Beta2Condition = "ControlPlaneMachinesReady"
228228

229-
// ClusterMachinesReadyV1Beta2Reason surfaces when all the controlled machine's Ready conditions are true.
230-
ClusterMachinesReadyV1Beta2Reason = ReadyV1Beta2Reason
229+
// ClusterControlPlaneMachinesReadyV1Beta2Reason surfaces when all control plane machine's Ready conditions are true.
230+
ClusterControlPlaneMachinesReadyV1Beta2Reason = ReadyV1Beta2Reason
231231

232-
// ClusterMachinesNotReadyV1Beta2Reason surfaces when at least one of the controlled machine's Ready conditions is false.
233-
ClusterMachinesNotReadyV1Beta2Reason = NotReadyV1Beta2Reason
232+
// ClusterControlPlaneMachinesNotReadyV1Beta2Reason surfaces when at least one of control plane machine's Ready conditions is false.
233+
ClusterControlPlaneMachinesNotReadyV1Beta2Reason = NotReadyV1Beta2Reason
234234

235-
// ClusterMachinesReadyUnknownV1Beta2Reason surfaces when at least one of the controlled machine's Ready conditions is unknown
236-
// and none of the controlled machine's Ready conditions is false.
237-
ClusterMachinesReadyUnknownV1Beta2Reason = ReadyUnknownV1Beta2Reason
235+
// ClusterControlPlaneMachinesReadyUnknownV1Beta2Reason surfaces when at least one of control plane machine's Ready conditions is unknown
236+
// and none of control plane machine's Ready conditions is false.
237+
ClusterControlPlaneMachinesReadyUnknownV1Beta2Reason = ReadyUnknownV1Beta2Reason
238238

239-
// ClusterMachinesReadyNoReplicasV1Beta2Reason surfaces when no machines exist for the Cluster.
240-
ClusterMachinesReadyNoReplicasV1Beta2Reason = NoReplicasV1Beta2Reason
239+
// ClusterControlPlaneMachinesReadyNoReplicasV1Beta2Reason surfaces when no control plane machines exist for the Cluster.
240+
ClusterControlPlaneMachinesReadyNoReplicasV1Beta2Reason = NoReplicasV1Beta2Reason
241241

242-
// ClusterMachinesReadyInternalErrorV1Beta2Reason surfaces unexpected failures when listing machines
243-
// or aggregating machine's conditions.
244-
ClusterMachinesReadyInternalErrorV1Beta2Reason = InternalErrorV1Beta2Reason
242+
// ClusterControlPlaneMachinesReadyInternalErrorV1Beta2Reason surfaces unexpected failures when listing control plane machines
243+
// or aggregating control plane machine's conditions.
244+
ClusterControlPlaneMachinesReadyInternalErrorV1Beta2Reason = InternalErrorV1Beta2Reason
245245
)
246246

247-
// Cluster's MachinesUpToDate condition and corresponding reasons that will be used in v1Beta2 API version.
247+
// Cluster's WorkerMachinesReady condition and corresponding reasons that will be used in v1Beta2 API version.
248248
const (
249-
// ClusterMachinesUpToDateV1Beta2Condition surfaces details of Cluster's machines not up to date, if any.
250-
ClusterMachinesUpToDateV1Beta2Condition = MachinesUpToDateV1Beta2Condition
249+
// ClusterWorkerMachinesReadyV1Beta2Condition surfaces detail of issues on the worker machines, if any.
250+
ClusterWorkerMachinesReadyV1Beta2Condition = "WorkerMachinesReady"
251251

252-
// ClusterMachinesUpToDateV1Beta2Reason surfaces when all the controlled machine's UpToDate conditions are true.
253-
ClusterMachinesUpToDateV1Beta2Reason = UpToDateV1Beta2Reason
252+
// ClusterWorkerMachinesReadyV1Beta2Reason surfaces when all the worker machine's Ready conditions are true.
253+
ClusterWorkerMachinesReadyV1Beta2Reason = ReadyV1Beta2Reason
254254

255-
// ClusterMachinesNotUpToDateV1Beta2Reason surfaces when at least one of the controlled machine's UpToDate conditions is false.
256-
ClusterMachinesNotUpToDateV1Beta2Reason = NotUpToDateV1Beta2Reason
255+
// ClusterWorkerMachinesNotReadyV1Beta2Reason surfaces when at least one of the worker machine's Ready conditions is false.
256+
ClusterWorkerMachinesNotReadyV1Beta2Reason = NotReadyV1Beta2Reason
257257

258-
// ClusterMachinesUpToDateUnknownV1Beta2Reason surfaces when at least one of the controlled machine's UpToDate conditions is unknown
259-
// and none of the controlled machine's UpToDate conditions is false.
260-
ClusterMachinesUpToDateUnknownV1Beta2Reason = UpToDateUnknownV1Beta2Reason
258+
// ClusterWorkerMachinesReadyUnknownV1Beta2Reason surfaces when at least one of the worker machine's Ready conditions is unknown
259+
// and none of the worker machine's Ready conditions is false.
260+
ClusterWorkerMachinesReadyUnknownV1Beta2Reason = ReadyUnknownV1Beta2Reason
261261

262-
// ClusterMachinesUpToDateNoReplicasV1Beta2Reason surfaces when no machines exist for the Cluster.
263-
ClusterMachinesUpToDateNoReplicasV1Beta2Reason = NoReplicasV1Beta2Reason
262+
// ClusterWorkerMachinesReadyNoReplicasV1Beta2Reason surfaces when no worker machines exist for the Cluster.
263+
ClusterWorkerMachinesReadyNoReplicasV1Beta2Reason = NoReplicasV1Beta2Reason
264264

265-
// ClusterMachinesUpToDateInternalErrorV1Beta2Reason surfaces unexpected failures when listing machines
265+
// ClusterWorkerMachinesReadyInternalErrorV1Beta2Reason surfaces unexpected failures when listing worker machines
266+
// or aggregating worker machine's conditions.
267+
ClusterWorkerMachinesReadyInternalErrorV1Beta2Reason = InternalErrorV1Beta2Reason
268+
)
269+
270+
// Cluster's ControlPlaneMachinesUpToDate condition and corresponding reasons that will be used in v1Beta2 API version.
271+
const (
272+
// ClusterControlPlaneMachinesUpToDateV1Beta2Condition surfaces details of control plane machines not up to date, if any.
273+
ClusterControlPlaneMachinesUpToDateV1Beta2Condition = "ControlPlaneMachinesUpToDate"
274+
275+
// ClusterControlPlaneMachinesUpToDateV1Beta2Reason surfaces when all the control plane machine's UpToDate conditions are true.
276+
ClusterControlPlaneMachinesUpToDateV1Beta2Reason = UpToDateV1Beta2Reason
277+
278+
// ClusterControlPlaneMachinesNotUpToDateV1Beta2Reason surfaces when at least one of the control plane machine's UpToDate conditions is false.
279+
ClusterControlPlaneMachinesNotUpToDateV1Beta2Reason = NotUpToDateV1Beta2Reason
280+
281+
// ClusterControlPlaneMachinesUpToDateUnknownV1Beta2Reason surfaces when at least one of the control plane machine's UpToDate conditions is unknown
282+
// and none of the control plane machine's UpToDate conditions is false.
283+
ClusterControlPlaneMachinesUpToDateUnknownV1Beta2Reason = UpToDateUnknownV1Beta2Reason
284+
285+
// ClusterControlPlaneMachinesUpToDateNoReplicasV1Beta2Reason surfaces when no control plane machines exist for the Cluster.
286+
ClusterControlPlaneMachinesUpToDateNoReplicasV1Beta2Reason = NoReplicasV1Beta2Reason
287+
288+
// ClusterControlPlaneMachinesUpToDateInternalErrorV1Beta2Reason surfaces unexpected failures when listing control plane machines
289+
// or aggregating status.
290+
ClusterControlPlaneMachinesUpToDateInternalErrorV1Beta2Reason = InternalErrorV1Beta2Reason
291+
)
292+
293+
// Cluster's WorkerMachinesUpToDate condition and corresponding reasons that will be used in v1Beta2 API version.
294+
const (
295+
// ClusterWorkerMachinesUpToDateV1Beta2Condition surfaces details of worker machines not up to date, if any.
296+
ClusterWorkerMachinesUpToDateV1Beta2Condition = "WorkerMachinesUpToDate"
297+
298+
// ClusterWorkerMachinesUpToDateV1Beta2Reason surfaces when all the worker machine's UpToDate conditions are true.
299+
ClusterWorkerMachinesUpToDateV1Beta2Reason = UpToDateV1Beta2Reason
300+
301+
// ClusterWorkerMachinesNotUpToDateV1Beta2Reason surfaces when at least one of the worker machine's UpToDate conditions is false.
302+
ClusterWorkerMachinesNotUpToDateV1Beta2Reason = NotUpToDateV1Beta2Reason
303+
304+
// ClusterWorkerMachinesUpToDateUnknownV1Beta2Reason surfaces when at least one of the worker machine's UpToDate conditions is unknown
305+
// and none of the worker machine's UpToDate conditions is false.
306+
ClusterWorkerMachinesUpToDateUnknownV1Beta2Reason = UpToDateUnknownV1Beta2Reason
307+
308+
// ClusterWorkerMachinesUpToDateNoReplicasV1Beta2Reason surfaces when no worker machines exist for the Cluster.
309+
ClusterWorkerMachinesUpToDateNoReplicasV1Beta2Reason = NoReplicasV1Beta2Reason
310+
311+
// ClusterWorkerMachinesUpToDateInternalErrorV1Beta2Reason surfaces unexpected failures when listing worker machines
266312
// or aggregating status.
267-
ClusterMachinesUpToDateInternalErrorV1Beta2Reason = InternalErrorV1Beta2Reason
313+
ClusterWorkerMachinesUpToDateInternalErrorV1Beta2Reason = InternalErrorV1Beta2Reason
268314
)
269315

270316
// Cluster's RemoteConnectionProbe condition and corresponding reasons that will be used in v1Beta2 API version.

internal/controllers/cluster/cluster_controller.go

+4-2
Original file line numberDiff line numberDiff line change
@@ -261,9 +261,11 @@ func patchCluster(ctx context.Context, patchHelper *patch.Helper, cluster *clust
261261
clusterv1.ClusterInfrastructureReadyV1Beta2Condition,
262262
clusterv1.ClusterControlPlaneAvailableV1Beta2Condition,
263263
clusterv1.ClusterControlPlaneInitializedV1Beta2Condition,
264+
clusterv1.ClusterControlPlaneMachinesReadyV1Beta2Condition,
265+
clusterv1.ClusterControlPlaneMachinesUpToDateV1Beta2Condition,
264266
clusterv1.ClusterWorkersAvailableV1Beta2Condition,
265-
clusterv1.ClusterMachinesReadyV1Beta2Condition,
266-
clusterv1.ClusterMachinesUpToDateV1Beta2Condition,
267+
clusterv1.ClusterWorkerMachinesReadyV1Beta2Condition,
268+
clusterv1.ClusterWorkerMachinesUpToDateV1Beta2Condition,
267269
clusterv1.ClusterRemoteConnectionProbeV1Beta2Condition,
268270
clusterv1.ClusterRollingOutV1Beta2Condition,
269271
clusterv1.ClusterScalingUpV1Beta2Condition,

0 commit comments

Comments
 (0)