@@ -123,15 +123,15 @@ func TestReconcileTopologyReconciledCondition(t *testing.T) {
123
123
},
124
124
UpgradeTracker : func () * scope.UpgradeTracker {
125
125
ut := scope .NewUpgradeTracker ()
126
- ut .ControlPlane .PendingUpgrade = true
126
+ ut .ControlPlane .IsPendingUpgrade = true
127
127
ut .ControlPlane .IsProvisioning = true
128
128
return ut
129
129
}(),
130
130
HookResponseTracker : scope .NewHookResponseTracker (),
131
131
},
132
132
wantConditionStatus : corev1 .ConditionFalse ,
133
133
wantConditionReason : clusterv1 .TopologyReconciledControlPlaneUpgradePendingReason ,
134
- wantConditionMessage : "Control plane upgrade to v1.22.0 on hold. Control plane is completing initial provisioning" ,
134
+ wantConditionMessage : "Control plane rollout and upgrade to version v1.22.0 on hold. Control plane is completing initial provisioning" ,
135
135
},
136
136
{
137
137
name : "should set the condition to false if new version is not picked up because control plane is upgrading" ,
@@ -154,15 +154,15 @@ func TestReconcileTopologyReconciledCondition(t *testing.T) {
154
154
},
155
155
UpgradeTracker : func () * scope.UpgradeTracker {
156
156
ut := scope .NewUpgradeTracker ()
157
- ut .ControlPlane .PendingUpgrade = true
157
+ ut .ControlPlane .IsPendingUpgrade = true
158
158
ut .ControlPlane .IsUpgrading = true
159
159
return ut
160
160
}(),
161
161
HookResponseTracker : scope .NewHookResponseTracker (),
162
162
},
163
163
wantConditionStatus : corev1 .ConditionFalse ,
164
164
wantConditionReason : clusterv1 .TopologyReconciledControlPlaneUpgradePendingReason ,
165
- wantConditionMessage : "Control plane upgrade to v1.22.0 on hold. Control plane is upgrading to version v1.21.2" ,
165
+ wantConditionMessage : "Control plane rollout and upgrade to version v1.22.0 on hold. Control plane is upgrading to version v1.21.2" ,
166
166
},
167
167
{
168
168
name : "should set the condition to false if new version is not picked up because control plane is scaling" ,
@@ -185,15 +185,15 @@ func TestReconcileTopologyReconciledCondition(t *testing.T) {
185
185
},
186
186
UpgradeTracker : func () * scope.UpgradeTracker {
187
187
ut := scope .NewUpgradeTracker ()
188
- ut .ControlPlane .PendingUpgrade = true
188
+ ut .ControlPlane .IsPendingUpgrade = true
189
189
ut .ControlPlane .IsScaling = true
190
190
return ut
191
191
}(),
192
192
HookResponseTracker : scope .NewHookResponseTracker (),
193
193
},
194
194
wantConditionStatus : corev1 .ConditionFalse ,
195
195
wantConditionReason : clusterv1 .TopologyReconciledControlPlaneUpgradePendingReason ,
196
- wantConditionMessage : "Control plane upgrade to v1.22.0 on hold. Control plane is reconciling desired replicas" ,
196
+ wantConditionMessage : "Control plane rollout and upgrade to version v1.22.0 on hold. Control plane is reconciling desired replicas" ,
197
197
},
198
198
{
199
199
name : "should set the condition to false if new version is not picked up because at least one of the machine deployment is upgrading" ,
@@ -230,15 +230,15 @@ func TestReconcileTopologyReconciledCondition(t *testing.T) {
230
230
},
231
231
UpgradeTracker : func () * scope.UpgradeTracker {
232
232
ut := scope .NewUpgradeTracker ()
233
- ut .ControlPlane .PendingUpgrade = true
233
+ ut .ControlPlane .IsPendingUpgrade = true
234
234
ut .MachineDeployments .MarkUpgrading ("md0-abc123" )
235
235
return ut
236
236
}(),
237
237
HookResponseTracker : scope .NewHookResponseTracker (),
238
238
},
239
239
wantConditionStatus : corev1 .ConditionFalse ,
240
240
wantConditionReason : clusterv1 .TopologyReconciledControlPlaneUpgradePendingReason ,
241
- wantConditionMessage : "Control plane upgrade to v1.22.0 on hold. MachineDeployment(s) md0-abc123 are upgrading" ,
241
+ wantConditionMessage : "Control plane rollout and upgrade to version v1.22.0 on hold. MachineDeployment(s) md0-abc123 are upgrading" ,
242
242
},
243
243
{
244
244
name : "should set the condition to false if control plane picked the new version but machine deployments did not because control plane is upgrading" ,
@@ -275,7 +275,7 @@ func TestReconcileTopologyReconciledCondition(t *testing.T) {
275
275
},
276
276
UpgradeTracker : func () * scope.UpgradeTracker {
277
277
ut := scope .NewUpgradeTracker ()
278
- ut .ControlPlane .PendingUpgrade = false
278
+ ut .ControlPlane .IsPendingUpgrade = false
279
279
ut .ControlPlane .IsUpgrading = true
280
280
ut .MachineDeployments .MarkPendingUpgrade ("md0-abc123" )
281
281
return ut
@@ -284,7 +284,7 @@ func TestReconcileTopologyReconciledCondition(t *testing.T) {
284
284
},
285
285
wantConditionStatus : corev1 .ConditionFalse ,
286
286
wantConditionReason : clusterv1 .TopologyReconciledMachineDeploymentsUpgradePendingReason ,
287
- wantConditionMessage : "MachineDeployment(s) md0-abc123 upgrade to version v1.22.0 on hold. Control plane is upgrading to version v1.22.0" ,
287
+ wantConditionMessage : "MachineDeployment(s) md0-abc123 rollout and upgrade to version v1.22.0 on hold. Control plane is upgrading to version v1.22.0" ,
288
288
},
289
289
{
290
290
name : "should set the condition to false if control plane picked the new version but machine deployments did not because control plane is scaling" ,
@@ -321,7 +321,7 @@ func TestReconcileTopologyReconciledCondition(t *testing.T) {
321
321
},
322
322
UpgradeTracker : func () * scope.UpgradeTracker {
323
323
ut := scope .NewUpgradeTracker ()
324
- ut .ControlPlane .PendingUpgrade = false
324
+ ut .ControlPlane .IsPendingUpgrade = false
325
325
ut .ControlPlane .IsScaling = true
326
326
ut .MachineDeployments .MarkPendingUpgrade ("md0-abc123" )
327
327
return ut
@@ -330,7 +330,39 @@ func TestReconcileTopologyReconciledCondition(t *testing.T) {
330
330
},
331
331
wantConditionStatus : corev1 .ConditionFalse ,
332
332
wantConditionReason : clusterv1 .TopologyReconciledMachineDeploymentsUpgradePendingReason ,
333
- wantConditionMessage : "MachineDeployment(s) md0-abc123 upgrade to version v1.22.0 on hold. Control plane is reconciling desired replicas" ,
333
+ wantConditionMessage : "MachineDeployment(s) md0-abc123 rollout and upgrade to version v1.22.0 on hold. Control plane is reconciling desired replicas" ,
334
+ },
335
+ {
336
+ name : "should set the condition to false if control plane picked the new version but there are machine deployments pending create because control plane is scaling" ,
337
+ reconcileErr : nil ,
338
+ cluster : & clusterv1.Cluster {},
339
+ s : & scope.Scope {
340
+ Blueprint : & scope.ClusterBlueprint {
341
+ Topology : & clusterv1.Topology {
342
+ Version : "v1.22.0" ,
343
+ },
344
+ },
345
+ Current : & scope.ClusterState {
346
+ Cluster : & clusterv1.Cluster {},
347
+ ControlPlane : & scope.ControlPlaneState {
348
+ Object : builder .ControlPlane ("ns1" , "controlplane1" ).
349
+ WithVersion ("v1.22.0" ).
350
+ WithReplicas (3 ).
351
+ Build (),
352
+ },
353
+ },
354
+ UpgradeTracker : func () * scope.UpgradeTracker {
355
+ ut := scope .NewUpgradeTracker ()
356
+ ut .ControlPlane .IsPendingUpgrade = false
357
+ ut .ControlPlane .IsScaling = true
358
+ ut .MachineDeployments .MarkPendingCreate ("md0" )
359
+ return ut
360
+ }(),
361
+ HookResponseTracker : scope .NewHookResponseTracker (),
362
+ },
363
+ wantConditionStatus : corev1 .ConditionFalse ,
364
+ wantConditionReason : clusterv1 .TopologyReconciledMachineDeploymentsCreatePendingReason ,
365
+ wantConditionMessage : "MachineDeployment(s) for Topologies md0 creation on hold. Control plane is reconciling desired replicas" ,
334
366
},
335
367
{
336
368
name : "should set the condition to true if control plane picked the new version and is upgrading but there are no machine deployments" ,
@@ -353,7 +385,7 @@ func TestReconcileTopologyReconciledCondition(t *testing.T) {
353
385
},
354
386
UpgradeTracker : func () * scope.UpgradeTracker {
355
387
ut := scope .NewUpgradeTracker ()
356
- ut .ControlPlane .PendingUpgrade = false
388
+ ut .ControlPlane .IsPendingUpgrade = false
357
389
ut .ControlPlane .IsUpgrading = true
358
390
return ut
359
391
}(),
@@ -382,7 +414,7 @@ func TestReconcileTopologyReconciledCondition(t *testing.T) {
382
414
},
383
415
UpgradeTracker : func () * scope.UpgradeTracker {
384
416
ut := scope .NewUpgradeTracker ()
385
- ut .ControlPlane .PendingUpgrade = false
417
+ ut .ControlPlane .IsPendingUpgrade = false
386
418
ut .ControlPlane .IsScaling = true
387
419
return ut
388
420
}(),
@@ -450,7 +482,7 @@ func TestReconcileTopologyReconciledCondition(t *testing.T) {
450
482
},
451
483
UpgradeTracker : func () * scope.UpgradeTracker {
452
484
ut := scope .NewUpgradeTracker ()
453
- ut .ControlPlane .PendingUpgrade = false
485
+ ut .ControlPlane .IsPendingUpgrade = false
454
486
ut .MachineDeployments .MarkUpgrading ("md0-abc123" )
455
487
ut .MachineDeployments .MarkPendingUpgrade ("md1-abc123" )
456
488
return ut
@@ -469,7 +501,7 @@ func TestReconcileTopologyReconciledCondition(t *testing.T) {
469
501
},
470
502
wantConditionStatus : corev1 .ConditionFalse ,
471
503
wantConditionReason : clusterv1 .TopologyReconciledMachineDeploymentsUpgradePendingReason ,
472
- wantConditionMessage : "MachineDeployment(s) md1-abc123 upgrade to version v1.22.0 on hold. MachineDeployment(s) md0-abc123 are upgrading" ,
504
+ wantConditionMessage : "MachineDeployment(s) md1-abc123 rollout and upgrade to version v1.22.0 on hold. MachineDeployment(s) md0-abc123 are upgrading" ,
473
505
},
474
506
{
475
507
name : "should set the condition to false if some machine deployments have not picked the new version because their upgrade has been deferred" ,
@@ -520,15 +552,15 @@ func TestReconcileTopologyReconciledCondition(t *testing.T) {
520
552
},
521
553
UpgradeTracker : func () * scope.UpgradeTracker {
522
554
ut := scope .NewUpgradeTracker ()
523
- ut .ControlPlane .PendingUpgrade = false
555
+ ut .ControlPlane .IsPendingUpgrade = false
524
556
ut .MachineDeployments .MarkDeferredUpgrade ("md1-abc123" )
525
557
return ut
526
558
}(),
527
559
HookResponseTracker : scope .NewHookResponseTracker (),
528
560
},
529
561
wantConditionStatus : corev1 .ConditionFalse ,
530
562
wantConditionReason : clusterv1 .TopologyReconciledMachineDeploymentsUpgradeDeferredReason ,
531
- wantConditionMessage : "MachineDeployment(s) md1-abc123 upgrade to version v1.22.0 deferred." ,
563
+ wantConditionMessage : "MachineDeployment(s) md1-abc123 rollout and upgrade to version v1.22.0 deferred." ,
532
564
},
533
565
{
534
566
name : "should set the condition to true if there are no reconcile errors and control plane and all machine deployments picked up the new version" ,
@@ -579,7 +611,7 @@ func TestReconcileTopologyReconciledCondition(t *testing.T) {
579
611
},
580
612
UpgradeTracker : func () * scope.UpgradeTracker {
581
613
ut := scope .NewUpgradeTracker ()
582
- ut .ControlPlane .PendingUpgrade = false
614
+ ut .ControlPlane .IsPendingUpgrade = false
583
615
return ut
584
616
}(),
585
617
HookResponseTracker : scope .NewHookResponseTracker (),
@@ -656,7 +688,7 @@ func TestComputeMachineDeploymentNameList(t *testing.T) {
656
688
for _ , tt := range tests {
657
689
t .Run (tt .name , func (t * testing.T ) {
658
690
g := NewWithT (t )
659
- g .Expect (computeMachineDeploymentNameList (tt .mdList )).To (Equal (tt .expected ))
691
+ g .Expect (computeNameList (tt .mdList )).To (Equal (tt .expected ))
660
692
})
661
693
}
662
694
}
0 commit comments