@@ -21,6 +21,7 @@ package e2e
21
21
22
22
import (
23
23
"context"
24
+ "fmt"
24
25
"time"
25
26
26
27
. "github.com/onsi/ginkgo/v2"
@@ -48,7 +49,7 @@ type ApplyManagedClusterTemplateAndWaitInput struct {
48
49
WaitForClusterIntervals []interface {}
49
50
WaitForControlPlaneIntervals []interface {}
50
51
WaitForMachinePools []interface {}
51
- Args [] string // extra args to be used during `kubectl apply`
52
+ Options []framework. CreateOrUpdateOption
52
53
PreWaitForCluster func ()
53
54
PostMachinesProvisioned func ()
54
55
WaitForControlPlaneInitialized Waiter
@@ -76,8 +77,7 @@ func ApplyManagedClusterTemplateAndWait(ctx context.Context, input ApplyManagedC
76
77
Expect (input .ConfigCluster .ControlPlaneMachineCount ).ToNot (BeNil ())
77
78
Expect (input .ConfigCluster .WorkerMachineCount ).ToNot (BeNil ())
78
79
79
- Byf ("Creating the GKE workload cluster with name %q using the %q template (Kubernetes %s)" ,
80
- input .ConfigCluster .ClusterName , input .ConfigCluster .Flavor , input .ConfigCluster .KubernetesVersion )
80
+ By (fmt .Sprintf ("Creating the GKE workload cluster with name %q using the %q template (Kubernetes %s)" , input .ConfigCluster .ClusterName , input .ConfigCluster .Flavor , input .ConfigCluster .KubernetesVersion ))
81
81
82
82
By ("Getting the cluster template yaml" )
83
83
workloadClusterTemplate := clusterctl .ConfigCluster (ctx , clusterctl.ConfigClusterInput {
@@ -102,7 +102,7 @@ func ApplyManagedClusterTemplateAndWait(ctx context.Context, input ApplyManagedC
102
102
103
103
By ("Applying the cluster template yaml to the cluster" )
104
104
Eventually (func () error {
105
- return input .ClusterProxy .Apply (ctx , workloadClusterTemplate , input .Args ... )
105
+ return input .ClusterProxy .CreateOrUpdate (ctx , workloadClusterTemplate , input .Options ... )
106
106
}, 10 * time .Second ).Should (Succeed (), "Failed to apply the cluster template" )
107
107
108
108
// Once we applied the cluster template we can run PreWaitForCluster.
0 commit comments