@@ -7,6 +7,7 @@ package e2e
7
7
8
8
import (
9
9
"fmt"
10
+ "os"
10
11
"slices"
11
12
"strconv"
12
13
"strings"
@@ -19,6 +20,7 @@ import (
19
20
clusterctlcluster "sigs.k8s.io/cluster-api/cmd/clusterctl/client/cluster"
20
21
capie2e "sigs.k8s.io/cluster-api/test/e2e"
21
22
capiframework "sigs.k8s.io/cluster-api/test/framework"
23
+ "sigs.k8s.io/cluster-api/test/framework/clusterctl"
22
24
23
25
"github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/api/v1alpha1"
24
26
apivariables "github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/api/variables"
@@ -60,24 +62,20 @@ var _ = Describe("Quick start", func() {
60
62
Context (
61
63
flavour ,
62
64
func () {
63
- capie2e .QuickStartSpec (ctx , func () capie2e.QuickStartSpecInput {
64
- if ! slices .Contains (
65
- e2eConfig .InfrastructureProviders (),
66
- lowercaseProvider ,
67
- ) {
68
- Fail (fmt .Sprintf (
69
- "provider %s is not enabled - check environment setup for provider specific requirements" ,
70
- lowercaseProvider ,
71
- ))
72
- }
65
+ var (
66
+ testE2EConfig * clusterctl.E2EConfig
67
+ clusterLocalClusterctlConfigPath string
68
+ )
69
+
70
+ BeforeEach (func () {
71
+ testE2EConfig = e2eConfig .DeepCopy ()
73
72
74
73
// Check if a provider-specific Kubernetes version is set in the environment and use that. This allows
75
74
// for testing against different Kubernetes versions, as some providers (e.g. Docker) have machine images
76
75
// available that are not available in other providers.
77
76
// This version can be specified in `test/e2e/config/caren.yaml` with a variable named
78
77
// `KUBERNETES_VERSION_<PROVIDER>`, where `<PROVIDER>` is the uppercase provider name, e.g.
79
78
// `KUBERNETES_VERSION_DOCKER: v1.29.5`.
80
- testE2EConfig := e2eConfig .DeepCopy ()
81
79
varName := capie2e .KubernetesVersion + "_" + strings .ToUpper (
82
80
lowercaseProvider ,
83
81
)
@@ -87,8 +85,8 @@ var _ = Describe("Quick start", func() {
87
85
)
88
86
}
89
87
90
- // For Nutanix provider, reserve an IP address for the workload cluster control plane endpoint - remember
91
- // to unreserve it!
88
+ // For Nutanix provider, reserve an IP address for the workload cluster control plane endpoint -
89
+ // remember to unreserve it!
92
90
if provider == "Nutanix" {
93
91
By (
94
92
"Reserving an IP address for the workload cluster control plane endpoint" ,
@@ -110,9 +108,31 @@ var _ = Describe("Quick start", func() {
110
108
testE2EConfig .Variables ["CONTROL_PLANE_ENDPOINT_IP" ] = controlPlaneEndpointIP
111
109
}
112
110
111
+ clusterLocalTempDir , err := os .MkdirTemp ("" , "clusterctl-" )
112
+ Expect (err ).ToNot (HaveOccurred ())
113
+ DeferCleanup (func () {
114
+ Expect (os .RemoveAll (clusterLocalTempDir )).To (Succeed ())
115
+ })
116
+ clusterLocalClusterctlConfigPath = createClusterctlLocalRepository (
117
+ testE2EConfig ,
118
+ clusterLocalTempDir ,
119
+ )
120
+ })
121
+
122
+ capie2e .QuickStartSpec (ctx , func () capie2e.QuickStartSpecInput {
123
+ if ! slices .Contains (
124
+ e2eConfig .InfrastructureProviders (),
125
+ lowercaseProvider ,
126
+ ) {
127
+ Fail (fmt .Sprintf (
128
+ "provider %s is not enabled - check environment setup for provider specific requirements" ,
129
+ lowercaseProvider ,
130
+ ))
131
+ }
132
+
113
133
return capie2e.QuickStartSpecInput {
114
134
E2EConfig : testE2EConfig ,
115
- ClusterctlConfigPath : clusterctlConfigPath ,
135
+ ClusterctlConfigPath : clusterLocalClusterctlConfigPath ,
116
136
BootstrapClusterProxy : bootstrapClusterProxy ,
117
137
ArtifactFolder : artifactFolder ,
118
138
SkipCleanup : skipCleanup ,
0 commit comments