Skip to content

Commit 8816570

Browse files
TMP Stop using deprecated counters in controllers
1 parent 59af9c5 commit 8816570

22 files changed

+140
-233
lines changed

exp/topology/desiredstate/desired_state_test.go

+3-7
Original file line numberDiff line numberDiff line change
@@ -1859,13 +1859,9 @@ func TestComputeMachineDeployment(t *testing.T) {
18591859
WithStatus(clusterv1.MachineDeploymentStatus{
18601860
ObservedGeneration: 2,
18611861
Replicas: 2,
1862-
Deprecated: &clusterv1.MachineDeploymentDeprecatedStatus{
1863-
V1Beta1: &clusterv1.MachineDeploymentV1Beta1DeprecatedStatus{
1864-
ReadyReplicas: 2,
1865-
UpdatedReplicas: 2,
1866-
AvailableReplicas: 2,
1867-
},
1868-
},
1862+
ReadyReplicas: ptr.To[int32](2),
1863+
UpToDateReplicas: ptr.To[int32](2),
1864+
AvailableReplicas: ptr.To[int32](2),
18691865
}).
18701866
Build()
18711867
mdsState = duplicateMachineDeploymentsState(mdsState)

internal/controllers/cluster/cluster_controller_status.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -1132,14 +1132,14 @@ func infrastructureReadyFallBackMessage(kind string, ready bool) string {
11321132
if ready {
11331133
return ""
11341134
}
1135-
return fmt.Sprintf("%s status.ready is %t", kind, ready)
1135+
return fmt.Sprintf("%s status.initialization.provisioned is %t", kind, ready)
11361136
}
11371137

11381138
func controlPlaneAvailableFallBackMessage(kind string, ready bool) string {
11391139
if ready {
11401140
return ""
11411141
}
1142-
return fmt.Sprintf("%s status.ready is %t", kind, ready)
1142+
return fmt.Sprintf("%s status.initialization.controlPlaneInitialized is %t", kind, ready)
11431143
}
11441144

11451145
func aggregateUnhealthyMachines(machines collections.Machines) string {

internal/controllers/cluster/cluster_controller_status_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ func TestSetInfrastructureReadyCondition(t *testing.T) {
270270
Type: clusterv1.ClusterInfrastructureReadyCondition,
271271
Status: metav1.ConditionFalse,
272272
Reason: clusterv1.ClusterInfrastructureNotReadyReason,
273-
Message: "FakeInfraCluster status.ready is false",
273+
Message: "FakeInfraCluster status.initialization.provisioned is false",
274274
},
275275
},
276276
{
@@ -435,7 +435,7 @@ func TestSetControlPlaneAvailableCondition(t *testing.T) {
435435
Type: clusterv1.ClusterControlPlaneAvailableCondition,
436436
Status: metav1.ConditionFalse,
437437
Reason: clusterv1.ClusterControlPlaneNotAvailableReason,
438-
Message: "FakeControlPlane status.ready is false",
438+
Message: "FakeControlPlane status.initialization.controlPlaneInitialized is false",
439439
},
440440
},
441441
{

internal/controllers/machine/machine_controller_status.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ func bootstrapConfigReadyFallBackMessage(kind string, ready bool) string {
157157
if ready {
158158
return ""
159159
}
160-
return fmt.Sprintf("%s status.ready is %t", kind, ready)
160+
return fmt.Sprintf("%s status.initialization.dataSecretCreated is %t", kind, ready)
161161
}
162162

163163
func setInfrastructureReadyCondition(_ context.Context, machine *clusterv1.Machine, infraMachine *unstructured.Unstructured, infraMachineIsNotFound bool) {
@@ -252,7 +252,7 @@ func infrastructureReadyFallBackMessage(kind string, ready bool) string {
252252
if ready {
253253
return ""
254254
}
255-
return fmt.Sprintf("%s status.ready is %t", kind, ready)
255+
return fmt.Sprintf("%s status.initialization.provisioned is %t", kind, ready)
256256
}
257257

258258
func setNodeHealthyAndReadyConditions(ctx context.Context, cluster *clusterv1.Cluster, machine *clusterv1.Machine, node *corev1.Node, nodeGetErr error, lastProbeSuccessTime time.Time, remoteConditionsGracePeriod time.Duration) {

internal/controllers/machine/machine_controller_status_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ func TestSetBootstrapReadyCondition(t *testing.T) {
161161
Type: clusterv1.MachineBootstrapConfigReadyCondition,
162162
Status: metav1.ConditionFalse,
163163
Reason: clusterv1.MachineBootstrapConfigNotReadyReason,
164-
Message: "GenericBootstrapConfig status.ready is false",
164+
Message: "GenericBootstrapConfig status.initialization.dataSecretCreated is false",
165165
},
166166
},
167167
{
@@ -385,7 +385,7 @@ func TestSetInfrastructureReadyCondition(t *testing.T) {
385385
Type: clusterv1.MachineInfrastructureReadyCondition,
386386
Status: metav1.ConditionFalse,
387387
Reason: clusterv1.MachineInfrastructureNotReadyReason,
388-
Message: "GenericInfrastructureMachine status.ready is false",
388+
Message: "GenericInfrastructureMachine status.initialization.provisioned is false",
389389
},
390390
},
391391
{

internal/controllers/machine/machine_controller_test.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -1161,8 +1161,8 @@ func TestMachineV1Beta1Conditions(t *testing.T) {
11611161
infraProvisioned: false,
11621162
bootstrapDataSecretCreated: true,
11631163
conditionsToAssert: []metav1.Condition{
1164-
{Type: clusterv1.MachineInfrastructureReadyCondition, Status: metav1.ConditionFalse, Reason: clusterv1.MachineInfrastructureNotReadyReason, Message: "GenericInfrastructureMachine status.ready is false"},
1165-
{Type: clusterv1.MachineReadyCondition, Status: metav1.ConditionFalse, Reason: clusterv1.MachineNotReadyReason, Message: "* InfrastructureReady: GenericInfrastructureMachine status.ready is false"},
1164+
{Type: clusterv1.MachineInfrastructureReadyCondition, Status: metav1.ConditionFalse, Reason: clusterv1.MachineInfrastructureNotReadyReason, Message: "GenericInfrastructureMachine status.initialization.provisioned is false"},
1165+
{Type: clusterv1.MachineReadyCondition, Status: metav1.ConditionFalse, Reason: clusterv1.MachineNotReadyReason, Message: "* InfrastructureReady: GenericInfrastructureMachine status.initialization.provisioned is false"},
11661166
},
11671167
v1beta1ConditionsToAssert: []*clusterv1.Condition{
11681168
v1beta1conditions.FalseCondition(clusterv1.InfrastructureReadyV1Beta1Condition, clusterv1.WaitingForInfrastructureFallbackV1Beta1Reason, clusterv1.ConditionSeverityInfo, ""),
@@ -1192,8 +1192,8 @@ func TestMachineV1Beta1Conditions(t *testing.T) {
11921192
infraProvisioned: true,
11931193
bootstrapDataSecretCreated: false,
11941194
conditionsToAssert: []metav1.Condition{
1195-
{Type: clusterv1.MachineBootstrapConfigReadyCondition, Status: metav1.ConditionFalse, Reason: clusterv1.MachineBootstrapConfigNotReadyReason, Message: "GenericBootstrapConfig status.ready is false"},
1196-
{Type: clusterv1.MachineReadyCondition, Status: metav1.ConditionFalse, Reason: clusterv1.MachineNotReadyReason, Message: "* BootstrapConfigReady: GenericBootstrapConfig status.ready is false"},
1195+
{Type: clusterv1.MachineBootstrapConfigReadyCondition, Status: metav1.ConditionFalse, Reason: clusterv1.MachineBootstrapConfigNotReadyReason, Message: "GenericBootstrapConfig status.initialization.dataSecretCreated is false"},
1196+
{Type: clusterv1.MachineReadyCondition, Status: metav1.ConditionFalse, Reason: clusterv1.MachineNotReadyReason, Message: "* BootstrapConfigReady: GenericBootstrapConfig status.initialization.dataSecretCreated is false"},
11971197
},
11981198
v1beta1ConditionsToAssert: []*clusterv1.Condition{
11991199
v1beta1conditions.FalseCondition(clusterv1.BootstrapReadyV1Beta1Condition, clusterv1.WaitingForDataSecretFallbackV1Beta1Reason, clusterv1.ConditionSeverityInfo, ""),
@@ -1207,7 +1207,7 @@ func TestMachineV1Beta1Conditions(t *testing.T) {
12071207
infraProvisioned: false,
12081208
bootstrapDataSecretCreated: false,
12091209
conditionsToAssert: []metav1.Condition{
1210-
{Type: clusterv1.MachineReadyCondition, Status: metav1.ConditionFalse, Reason: clusterv1.MachineNotReadyReason, Message: "* BootstrapConfigReady: GenericBootstrapConfig status.ready is false\n* InfrastructureReady: GenericInfrastructureMachine status.ready is false"},
1210+
{Type: clusterv1.MachineReadyCondition, Status: metav1.ConditionFalse, Reason: clusterv1.MachineNotReadyReason, Message: "* BootstrapConfigReady: GenericBootstrapConfig status.initialization.dataSecretCreated is false\n* InfrastructureReady: GenericInfrastructureMachine status.initialization.provisioned is false"},
12111211
},
12121212
v1beta1ConditionsToAssert: []*clusterv1.Condition{
12131213
// in V1beta1 ready condition summary consumes reason from the infra condition

internal/controllers/machinedeployment/machinedeployment_controller_test.go

+7-2
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ func TestMachineDeploymentReconciler(t *testing.T) {
6565
// Set InfrastructureReady to true so ClusterCache creates the clusterAccessor.
6666
patch := client.MergeFrom(cluster.DeepCopy())
6767
cluster.Status.Initialization = &clusterv1.ClusterInitializationStatus{InfrastructureProvisioned: true}
68+
69+
cluster.Status.Conditions = []metav1.Condition{{Type: clusterv1.ClusterControlPlaneInitializedCondition, Status: metav1.ConditionTrue, Reason: clusterv1.ClusterControlPlaneInitializedReason, LastTransitionTime: metav1.Now()}}
6870
g.Expect(env.Status().Patch(ctx, cluster, patch)).To(Succeed())
6971

7072
return ns, cluster
@@ -432,8 +434,11 @@ func TestMachineDeploymentReconciler(t *testing.T) {
432434
if !metav1.IsControlledBy(&m, newestMachineSet) {
433435
continue
434436
}
435-
providerID := fakeInfrastructureRefProvisioned(m.Spec.InfrastructureRef, infraResource, g)
436-
fakeMachineNodeRef(&m, providerID, g)
437+
438+
if m.Status.NodeRef == nil {
439+
providerID := fakeInfrastructureRefProvisioned(m.Spec.InfrastructureRef, infraResource, g)
440+
fakeMachineNodeRef(&m, providerID, g)
441+
}
437442
}
438443

439444
if err := env.List(ctx, machineSets, msListOpts...); err != nil {

internal/controllers/machinedeployment/machinedeployment_rolling.go

+4-11
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import (
2222

2323
"github.com/pkg/errors"
2424
"k8s.io/klog/v2"
25+
"k8s.io/utils/ptr"
2526
ctrl "sigs.k8s.io/controller-runtime"
2627
"sigs.k8s.io/controller-runtime/pkg/client"
2728

@@ -157,11 +158,7 @@ func (r *Reconciler) reconcileOldMachineSets(ctx context.Context, allMSs []*clus
157158
// * The new MachineSet created must start with 0 replicas because allMachinesCount is already at 13.
158159
// * However, newMSMachinesUnavailable would also be 0, so the 2 old MachineSets could be scaled down by 5 (13 - 8 - 0), which would then
159160
// allow the new MachineSet to be scaled up by 5.
160-
// TODO (v1beta2) Use new replica counters
161-
availableReplicas := int32(0)
162-
if newMS.Status.Deprecated != nil && newMS.Status.Deprecated.V1Beta1 != nil {
163-
availableReplicas = newMS.Status.Deprecated.V1Beta1.AvailableReplicas
164-
}
161+
availableReplicas := ptr.Deref(newMS.Status.AvailableReplicas, 0)
165162

166163
minAvailable := *(deployment.Spec.Replicas) - maxUnavailable
167164
newMSUnavailableMachineCount := *(newMS.Spec.Replicas) - availableReplicas
@@ -218,11 +215,7 @@ func (r *Reconciler) cleanupUnhealthyReplicas(ctx context.Context, oldMSs []*clu
218215
continue
219216
}
220217

221-
// TODO (v1beta2) Use new replica counters
222-
oldMSAvailableReplicas := int32(0)
223-
if targetMS.Status.Deprecated != nil && targetMS.Status.Deprecated.V1Beta1 != nil {
224-
oldMSAvailableReplicas = targetMS.Status.Deprecated.V1Beta1.AvailableReplicas
225-
}
218+
oldMSAvailableReplicas := ptr.Deref(targetMS.Status.AvailableReplicas, 0)
226219
log.V(4).Info("Found available Machines in old MachineSet",
227220
"count", oldMSAvailableReplicas, "target-machineset", client.ObjectKeyFromObject(targetMS).String())
228221
if oldMSReplicas == oldMSAvailableReplicas {
@@ -263,7 +256,7 @@ func (r *Reconciler) scaleDownOldMachineSetsForRollingUpdate(ctx context.Context
263256
minAvailable := *(deployment.Spec.Replicas) - maxUnavailable
264257

265258
// Find the number of available machines.
266-
availableMachineCount := mdutil.GetAvailableReplicaCountForMachineSets(allMSs)
259+
availableMachineCount := ptr.Deref(mdutil.GetAvailableReplicaCountForMachineSets(allMSs), 0)
267260

268261
// Check if we can scale down.
269262
if availableMachineCount <= minAvailable {

internal/controllers/machinedeployment/machinedeployment_rolling_test.go

+6-28
Original file line numberDiff line numberDiff line change
@@ -367,11 +367,7 @@ func TestReconcileOldMachineSets(t *testing.T) {
367367
Replicas: ptr.To[int32](0),
368368
},
369369
Status: clusterv1.MachineSetStatus{
370-
Deprecated: &clusterv1.MachineSetDeprecatedStatus{
371-
V1Beta1: &clusterv1.MachineSetV1Beta1DeprecatedStatus{
372-
AvailableReplicas: 2,
373-
},
374-
},
370+
AvailableReplicas: ptr.To[int32](2),
375371
},
376372
},
377373
oldMachineSets: []*clusterv1.MachineSet{
@@ -384,11 +380,7 @@ func TestReconcileOldMachineSets(t *testing.T) {
384380
Replicas: ptr.To[int32](2),
385381
},
386382
Status: clusterv1.MachineSetStatus{
387-
Deprecated: &clusterv1.MachineSetDeprecatedStatus{
388-
V1Beta1: &clusterv1.MachineSetV1Beta1DeprecatedStatus{
389-
AvailableReplicas: 2,
390-
},
391-
},
383+
AvailableReplicas: ptr.To[int32](2),
392384
},
393385
},
394386
{
@@ -400,11 +392,7 @@ func TestReconcileOldMachineSets(t *testing.T) {
400392
Replicas: ptr.To[int32](1),
401393
},
402394
Status: clusterv1.MachineSetStatus{
403-
Deprecated: &clusterv1.MachineSetDeprecatedStatus{
404-
V1Beta1: &clusterv1.MachineSetV1Beta1DeprecatedStatus{
405-
AvailableReplicas: 1,
406-
},
407-
},
395+
AvailableReplicas: ptr.To[int32](1),
408396
},
409397
},
410398
},
@@ -438,12 +426,6 @@ func TestReconcileOldMachineSets(t *testing.T) {
438426
},
439427
Status: clusterv1.MachineSetStatus{
440428
Replicas: 5,
441-
Deprecated: &clusterv1.MachineSetDeprecatedStatus{
442-
V1Beta1: &clusterv1.MachineSetV1Beta1DeprecatedStatus{
443-
ReadyReplicas: 0,
444-
AvailableReplicas: 0,
445-
},
446-
},
447429
},
448430
},
449431
oldMachineSets: []*clusterv1.MachineSet{
@@ -456,13 +438,9 @@ func TestReconcileOldMachineSets(t *testing.T) {
456438
Replicas: ptr.To[int32](8),
457439
},
458440
Status: clusterv1.MachineSetStatus{
459-
Replicas: 10,
460-
Deprecated: &clusterv1.MachineSetDeprecatedStatus{
461-
V1Beta1: &clusterv1.MachineSetV1Beta1DeprecatedStatus{
462-
ReadyReplicas: 8,
463-
AvailableReplicas: 8,
464-
},
465-
},
441+
Replicas: 10,
442+
ReadyReplicas: ptr.To[int32](8),
443+
AvailableReplicas: ptr.To[int32](8),
466444
},
467445
},
468446
},

internal/controllers/machinedeployment/machinedeployment_status.go

+6-6
Original file line numberDiff line numberDiff line change
@@ -75,16 +75,16 @@ func (r *Reconciler) updateStatus(ctx context.Context, s *scope) (retErr error)
7575
return retErr
7676
}
7777

78-
// setReplicas sets replicas in the v1beta2 status.
78+
// setReplicas sets replicas in status.
7979
// Note: this controller computes replicas several time during a reconcile, because those counters are
8080
// used by low level operations to take decisions, but also those decisions might impact the very same the counters
8181
// e.g. scale up MachinesSet is based on counters and it can change the value on MachineSet's replica number;
8282
// as a consequence it is required to compute the counters again before calling scale down machine sets,
8383
// and again to before computing the overall availability of the Machine deployment.
8484
func setReplicas(machineDeployment *clusterv1.MachineDeployment, machineSets []*clusterv1.MachineSet) {
85-
machineDeployment.Status.ReadyReplicas = mdutil.GetV1Beta2ReadyReplicaCountForMachineSets(machineSets)
86-
machineDeployment.Status.AvailableReplicas = mdutil.GetV1Beta2AvailableReplicaCountForMachineSets(machineSets)
87-
machineDeployment.Status.UpToDateReplicas = mdutil.GetV1Beta2UptoDateReplicaCountForMachineSets(machineSets)
85+
machineDeployment.Status.ReadyReplicas = mdutil.GetReadyReplicaCountForMachineSets(machineSets)
86+
machineDeployment.Status.AvailableReplicas = mdutil.GetAvailableReplicaCountForMachineSets(machineSets)
87+
machineDeployment.Status.UpToDateReplicas = mdutil.GetUptoDateReplicaCountForMachineSets(machineSets)
8888
}
8989

9090
func setAvailableCondition(_ context.Context, machineDeployment *clusterv1.MachineDeployment, getAndAdoptMachineSetsForDeploymentSucceeded bool) {
@@ -110,13 +110,13 @@ func setAvailableCondition(_ context.Context, machineDeployment *clusterv1.Machi
110110
return
111111
}
112112

113-
// Surface if .status.v1beta2.availableReplicas is not yet set.
113+
// Surface if .status.availableReplicas is not yet set.
114114
if machineDeployment.Status.AvailableReplicas == nil {
115115
conditions.Set(machineDeployment, metav1.Condition{
116116
Type: clusterv1.MachineDeploymentAvailableCondition,
117117
Status: metav1.ConditionUnknown,
118118
Reason: clusterv1.MachineDeploymentAvailableWaitingForAvailableReplicasSetReason,
119-
Message: "Waiting for status.v1beta2.availableReplicas set",
119+
Message: "Waiting for status.availableReplicas set",
120120
})
121121
return
122122
}

internal/controllers/machinedeployment/machinedeployment_status_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ func Test_setAvailableCondition(t *testing.T) {
120120
Type: clusterv1.MachineDeploymentAvailableCondition,
121121
Status: metav1.ConditionUnknown,
122122
Reason: clusterv1.MachineDeploymentAvailableWaitingForAvailableReplicasSetReason,
123-
Message: "Waiting for status.v1beta2.availableReplicas set",
123+
Message: "Waiting for status.availableReplicas set",
124124
},
125125
},
126126
{

internal/controllers/machinedeployment/machinedeployment_sync.go

+8-9
Original file line numberDiff line numberDiff line change
@@ -477,18 +477,17 @@ func (r *Reconciler) scale(ctx context.Context, deployment *clusterv1.MachineDep
477477

478478
// syncDeploymentStatus checks if the status is up-to-date and sync it if necessary.
479479
func (r *Reconciler) syncDeploymentStatus(allMSs []*clusterv1.MachineSet, newMS *clusterv1.MachineSet, md *clusterv1.MachineDeployment) error {
480-
md.Status = calculateStatus(allMSs, newMS, md)
480+
md.Status = calculateV1Beta1Status(allMSs, newMS, md)
481481

482482
// minReplicasNeeded will be equal to md.Spec.Replicas when the strategy is not RollingUpdateMachineDeploymentStrategyType.
483483
minReplicasNeeded := *(md.Spec.Replicas) - mdutil.MaxUnavailable(*md)
484484

485-
// TODO: v1beta2
486485
availableReplicas := int32(0)
487486
if md.Status.Deprecated != nil && md.Status.Deprecated.V1Beta1 != nil {
488487
availableReplicas = md.Status.Deprecated.V1Beta1.AvailableReplicas
489488
}
490489
if availableReplicas >= minReplicasNeeded {
491-
// NOTE: The structure of calculateStatus() does not allow us to update the machinedeployment directly, we can only update the status obj it returns. Ideally, we should change calculateStatus() --> updateStatus() to be consistent with the rest of the code base, until then, we update conditions here.
490+
// NOTE: The structure of calculateV1Beta1Status() does not allow us to update the machinedeployment directly, we can only update the status obj it returns. Ideally, we should change calculateV1Beta1Status() --> updateStatus() to be consistent with the rest of the code base, until then, we update conditions here.
492491
v1beta1conditions.MarkTrue(md, clusterv1.MachineDeploymentAvailableV1Beta1Condition)
493492
} else {
494493
v1beta1conditions.MarkFalse(md, clusterv1.MachineDeploymentAvailableV1Beta1Condition, clusterv1.WaitingForAvailableMachinesV1Beta1Reason, clusterv1.ConditionSeverityWarning, "Minimum availability requires %d replicas, current %d available", minReplicasNeeded, md.Status.AvailableReplicas)
@@ -504,15 +503,15 @@ func (r *Reconciler) syncDeploymentStatus(allMSs []*clusterv1.MachineSet, newMS
504503
v1beta1conditions.MarkFalse(md, clusterv1.MachineSetReadyV1Beta1Condition, clusterv1.WaitingForMachineSetFallbackV1Beta1Reason, clusterv1.ConditionSeverityInfo, "MachineSet not found")
505504
}
506505

507-
// Set v1beta replica counters on MD status.
506+
// Set replica counters on MD status.
508507
setReplicas(md, allMSs)
509508

510509
return nil
511510
}
512511

513-
// calculateStatus calculates the latest status for the provided deployment by looking into the provided MachineSets.
514-
func calculateStatus(allMSs []*clusterv1.MachineSet, newMS *clusterv1.MachineSet, deployment *clusterv1.MachineDeployment) clusterv1.MachineDeploymentStatus {
515-
availableReplicas := mdutil.GetAvailableReplicaCountForMachineSets(allMSs)
512+
// calculateV1Beta1Status calculates the latest status for the provided deployment by looking into the provided MachineSets.
513+
func calculateV1Beta1Status(allMSs []*clusterv1.MachineSet, newMS *clusterv1.MachineSet, deployment *clusterv1.MachineDeployment) clusterv1.MachineDeploymentStatus {
514+
availableReplicas := mdutil.GetV1Beta1AvailableReplicaCountForMachineSets(allMSs)
516515
totalReplicas := mdutil.GetReplicaCountForMachineSets(allMSs)
517516
unavailableReplicas := totalReplicas - availableReplicas
518517

@@ -525,7 +524,7 @@ func calculateStatus(allMSs []*clusterv1.MachineSet, newMS *clusterv1.MachineSet
525524
// Calculate the label selector. We check the error in the MD reconcile function, ignore here.
526525
selector, _ := metav1.LabelSelectorAsSelector(&deployment.Spec.Selector)
527526

528-
// TODO (v1beta2) Use new replica counters
527+
// Carry over deprecated v1beta1 conditions if defined.
529528
var conditions clusterv1.Conditions
530529
if deployment.Status.Deprecated != nil && deployment.Status.Deprecated.V1Beta1 != nil {
531530
conditions = deployment.Status.Deprecated.V1Beta1.Conditions
@@ -540,7 +539,7 @@ func calculateStatus(allMSs []*clusterv1.MachineSet, newMS *clusterv1.MachineSet
540539
V1Beta1: &clusterv1.MachineDeploymentV1Beta1DeprecatedStatus{
541540
Conditions: conditions,
542541
UpdatedReplicas: mdutil.GetActualReplicaCountForMachineSets([]*clusterv1.MachineSet{newMS}),
543-
ReadyReplicas: mdutil.GetReadyReplicaCountForMachineSets(allMSs),
542+
ReadyReplicas: mdutil.GetV1Beta1ReadyReplicaCountForMachineSets(allMSs),
544543
AvailableReplicas: availableReplicas,
545544
UnavailableReplicas: unavailableReplicas,
546545
},

0 commit comments

Comments
 (0)