@@ -18,6 +18,7 @@ package clusterctl
18
18
19
19
import (
20
20
"context"
21
+ "fmt"
21
22
"os"
22
23
"path/filepath"
23
24
"time"
@@ -286,10 +287,15 @@ func ApplyClusterTemplateAndWait(ctx context.Context, input ApplyClusterTemplate
286
287
Expect (input .ClusterProxy ).ToNot (BeNil (), "Invalid argument. input.ClusterProxy can't be nil when calling ApplyClusterTemplateAndWait" )
287
288
Expect (result ).ToNot (BeNil (), "Invalid argument. result can't be nil when calling ApplyClusterTemplateAndWait" )
288
289
Expect (input .ConfigCluster .ControlPlaneMachineCount ).ToNot (BeNil ())
289
- Expect (input .ConfigCluster .WorkerMachineCount ).ToNot (BeNil ())
290
290
291
- log .Logf ("Creating the workload cluster with name %q using the %q template (Kubernetes %s, %d control-plane machines, %d worker machines)" ,
292
- input .ConfigCluster .ClusterName , valueOrDefault (input .ConfigCluster .Flavor ), input .ConfigCluster .KubernetesVersion , * input .ConfigCluster .ControlPlaneMachineCount , * input .ConfigCluster .WorkerMachineCount )
291
+ var workerMachinesCount string
292
+ if input .ConfigCluster .WorkerMachineCount != nil {
293
+ workerMachinesCount = fmt .Sprintf ("%d" , * input .ConfigCluster .WorkerMachineCount )
294
+ } else {
295
+ workerMachinesCount = "(unset)"
296
+ }
297
+ log .Logf ("Creating the workload cluster with name %q using the %q template (Kubernetes %s, %d control-plane machines, %s worker machines)" ,
298
+ input .ConfigCluster .ClusterName , valueOrDefault (input .ConfigCluster .Flavor ), input .ConfigCluster .KubernetesVersion , * input .ConfigCluster .ControlPlaneMachineCount , workerMachinesCount )
293
299
294
300
// Ensure we have a Cluster for dump and cleanup steps in AfterEach even if ApplyClusterTemplateAndWait fails.
295
301
result .Cluster = & clusterv1.Cluster {
0 commit comments