Skip to content

Commit 21f63b9

Browse files
committed
Fix e2e tests
Signed-off-by: Tamal Saha <[email protected]>
1 parent 4ffde27 commit 21f63b9

14 files changed

+35
-35
lines changed

test/e2e/shared/aws.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -903,7 +903,7 @@ func DumpCloudTrailEvents(e2eCtx *E2EContext) {
903903
// conformanceImageID looks up a specific image for a given
904904
// Kubernetes version in the e2econfig.
905905
func conformanceImageID(e2eCtx *E2EContext) string {
906-
ver := e2eCtx.E2EConfig.GetVariable("CONFORMANCE_CI_ARTIFACTS_KUBERNETES_VERSION")
906+
ver := e2eCtx.E2EConfig.MustGetVariable("CONFORMANCE_CI_ARTIFACTS_KUBERNETES_VERSION")
907907
amiName := AMIPrefix + ver + "*"
908908

909909
By(fmt.Sprintf("Searching for AMI: name=%s", amiName))

test/e2e/shared/cluster.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ func createClusterctlLocalRepository(e2eCtx *E2EContext, repositoryFolder string
4343
if !e2eCtx.IsManaged {
4444
// Ensuring a CNI file is defined in the config and register a FileTransformation to inject the referenced file as in place of the CNI_RESOURCES envSubst variable.
4545
Expect(e2eCtx.E2EConfig.Variables).To(HaveKey(capi_e2e.CNIPath), "Missing %s variable in the config", capi_e2e.CNIPath)
46-
cniPath := e2eCtx.E2EConfig.GetVariable(capi_e2e.CNIPath)
46+
cniPath := e2eCtx.E2EConfig.MustGetVariable(capi_e2e.CNIPath)
4747
Expect(cniPath).To(BeAnExistingFile(), "The %s variable should resolve to an existing file", capi_e2e.CNIPath)
4848
createRepositoryInput.RegisterClusterResourceSetConfigMapTransformation(cniPath, capi_e2e.CNIResources)
4949
}
@@ -60,7 +60,7 @@ func setupBootstrapCluster(config *clusterctl.E2EConfig, scheme *runtime.Scheme,
6060
if !useExistingCluster {
6161
clusterProvider = bootstrap.CreateKindBootstrapClusterAndLoadImages(context.TODO(), bootstrap.CreateKindBootstrapClusterAndLoadImagesInput{
6262
Name: config.ManagementClusterName,
63-
KubernetesVersion: config.GetVariable(KubernetesVersionManagement),
63+
KubernetesVersion: config.MustGetVariable(KubernetesVersionManagement),
6464
RequiresDockerSock: config.HasDockerProvider(),
6565
Images: config.Images,
6666
})

test/e2e/shared/suite.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ func Node1BeforeSuite(e2eCtx *E2EContext) []byte {
180180
WriteAWSResourceQuotesToFile(path.Join(e2eCtx.Settings.ArtifactFolder, "initial-aws-resource-quotas.yaml"), originalQuotas)
181181
}
182182

183-
e2eCtx.Settings.InstanceVCPU, err = strconv.Atoi(e2eCtx.E2EConfig.GetVariable(InstanceVcpu))
183+
e2eCtx.Settings.InstanceVCPU, err = strconv.Atoi(e2eCtx.E2EConfig.MustGetVariable(InstanceVcpu))
184184
Expect(err).NotTo(HaveOccurred())
185185

186186
By("Initializing the bootstrap cluster")

test/e2e/suites/conformance/conformance_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,17 +66,17 @@ var _ = ginkgo.Describe("[unmanaged] [conformance] tests", func() {
6666
ginkgo.AddReportEntry(experiment.Name, experiment)
6767
experiment.Sample(func(idx int) {
6868
shared.SetEnvVar("USE_CI_ARTIFACTS", "true", false)
69-
kubernetesVersion := e2eCtx.E2EConfig.GetVariable(shared.KubernetesVersion)
69+
kubernetesVersion := e2eCtx.E2EConfig.MustGetVariable(shared.KubernetesVersion)
7070
flavor := clusterctl.DefaultFlavor
7171
if e2eCtx.Settings.UseCIArtifacts {
7272
flavor = "conformance-ci-artifacts"
7373
var err error
7474
kubernetesVersion, err = kubernetesversions.LatestCIRelease()
7575
Expect(err).NotTo(HaveOccurred())
7676
}
77-
workerMachineCount, err := strconv.ParseInt(e2eCtx.E2EConfig.GetVariable("CONFORMANCE_WORKER_MACHINE_COUNT"), 10, 64)
77+
workerMachineCount, err := strconv.ParseInt(e2eCtx.E2EConfig.MustGetVariable("CONFORMANCE_WORKER_MACHINE_COUNT"), 10, 64)
7878
Expect(err).NotTo(HaveOccurred())
79-
controlPlaneMachineCount, err := strconv.ParseInt(e2eCtx.E2EConfig.GetVariable("CONFORMANCE_CONTROL_PLANE_MACHINE_COUNT"), 10, 64)
79+
controlPlaneMachineCount, err := strconv.ParseInt(e2eCtx.E2EConfig.MustGetVariable("CONFORMANCE_CONTROL_PLANE_MACHINE_COUNT"), 10, 64)
8080
Expect(err).NotTo(HaveOccurred())
8181

8282
// Starting with Kubernetes v1.25, the kubetest config file needs to be compatible with Ginkgo V2.

test/e2e/suites/gc_managed/gc_managed_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ var _ = ginkgo.Describe("[managed] [gc] EKS Cluster external resource GC tests",
100100
Expect(len(mp)).To(Equal(1))
101101

102102
workloadClusterProxy := e2eCtx.Environment.BootstrapClusterProxy.GetWorkloadCluster(ctx, cluster.Namespace, cluster.Name)
103-
workloadYamlPath := e2eCtx.E2EConfig.GetVariable(shared.GcWorkloadPath)
103+
workloadYamlPath := e2eCtx.E2EConfig.MustGetVariable(shared.GcWorkloadPath)
104104
ginkgo.By(fmt.Sprintf("Installing sample workload with load balancer services: %s", workloadYamlPath))
105105
workloadYaml, err := os.ReadFile(workloadYamlPath) //nolint:gosec
106106
Expect(err).ShouldNot(HaveOccurred())
@@ -221,7 +221,7 @@ var _ = ginkgo.Describe("[managed] [gc] EKS Cluster external resource GC tests",
221221
Expect(len(mp)).To(Equal(1))
222222

223223
workloadClusterProxy := e2eCtx.Environment.BootstrapClusterProxy.GetWorkloadCluster(ctx, cluster.Namespace, cluster.Name)
224-
workloadYamlPath := e2eCtx.E2EConfig.GetVariable(shared.GcWorkloadPath)
224+
workloadYamlPath := e2eCtx.E2EConfig.MustGetVariable(shared.GcWorkloadPath)
225225
ginkgo.By(fmt.Sprintf("Installing sample workload with load balancer services: %s", workloadYamlPath))
226226
workloadYaml, err := os.ReadFile(workloadYamlPath) //nolint:gosec
227227
Expect(err).ShouldNot(HaveOccurred())
@@ -300,7 +300,7 @@ func defaultConfigCluster(clusterName, namespace string) clusterctl.ConfigCluste
300300
Flavor: ms.EKSManagedPoolFlavor,
301301
Namespace: namespace,
302302
ClusterName: clusterName,
303-
KubernetesVersion: e2eCtx.E2EConfig.GetVariable(shared.KubernetesVersion),
303+
KubernetesVersion: e2eCtx.E2EConfig.MustGetVariable(shared.KubernetesVersion),
304304
ControlPlaneMachineCount: ptr.To[int64](1),
305305
WorkerMachineCount: ptr.To[int64](0),
306306
}

test/e2e/suites/gc_unmanaged/gc_unmanaged_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ var _ = ginkgo.Context("[unmanaged] [gc]", func() {
7979
Expect(cluster).NotTo(BeNil(), "couldn't find cluster")
8080

8181
workloadClusterProxy := e2eCtx.Environment.BootstrapClusterProxy.GetWorkloadCluster(ctx, cluster.Namespace, cluster.Name)
82-
workloadYamlPath := e2eCtx.E2EConfig.GetVariable(shared.GcWorkloadPath)
82+
workloadYamlPath := e2eCtx.E2EConfig.MustGetVariable(shared.GcWorkloadPath)
8383
ginkgo.By(fmt.Sprintf("Installing sample workload with load balancer services: %s", workloadYamlPath))
8484
workloadYaml, err := os.ReadFile(workloadYamlPath) //nolint:gosec
8585
Expect(err).ShouldNot(HaveOccurred())
@@ -183,7 +183,7 @@ var _ = ginkgo.Context("[unmanaged] [gc]", func() {
183183
Expect(cluster).NotTo(BeNil(), "couldn't find cluster")
184184

185185
workloadClusterProxy := e2eCtx.Environment.BootstrapClusterProxy.GetWorkloadCluster(ctx, cluster.Namespace, cluster.Name)
186-
workloadYamlPath := e2eCtx.E2EConfig.GetVariable(shared.GcWorkloadPath)
186+
workloadYamlPath := e2eCtx.E2EConfig.MustGetVariable(shared.GcWorkloadPath)
187187
ginkgo.By(fmt.Sprintf("Installing sample workload with load balancer services: %s", workloadYamlPath))
188188
workloadYaml, err := os.ReadFile(workloadYamlPath) //nolint:gosec
189189
Expect(err).ShouldNot(HaveOccurred())
@@ -262,7 +262,7 @@ func defaultConfigCluster(clusterName, namespace string) clusterctl.ConfigCluste
262262
Flavor: clusterctl.DefaultFlavor,
263263
Namespace: namespace,
264264
ClusterName: clusterName,
265-
KubernetesVersion: e2eCtx.E2EConfig.GetVariable(shared.KubernetesVersion),
265+
KubernetesVersion: e2eCtx.E2EConfig.MustGetVariable(shared.KubernetesVersion),
266266
ControlPlaneMachineCount: ptr.To[int64](1),
267267
WorkerMachineCount: ptr.To[int64](0),
268268
}

test/e2e/suites/managed/eks_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ var _ = ginkgo.Describe("[managed] [general] EKS cluster tests", func() {
9393
Namespace: namespace,
9494
ClusterName: clusterName,
9595
AddonName: cniAddonName,
96-
AddonVersion: e2eCtx.E2EConfig.GetVariable(shared.CNIAddonVersion),
96+
AddonVersion: e2eCtx.E2EConfig.MustGetVariable(shared.CNIAddonVersion),
9797
}
9898
})
9999

test/e2e/suites/managed/helpers_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ func defaultConfigCluster(clusterName, namespace string) clusterctl.ConfigCluste
3737
Flavor: EKSManagedPoolFlavor,
3838
Namespace: namespace,
3939
ClusterName: clusterName,
40-
KubernetesVersion: e2eCtx.E2EConfig.GetVariable(shared.KubernetesVersion),
40+
KubernetesVersion: e2eCtx.E2EConfig.MustGetVariable(shared.KubernetesVersion),
4141
ControlPlaneMachineCount: ptr.To[int64](1),
4242
WorkerMachineCount: ptr.To[int64](0),
4343
}

test/e2e/suites/managed/upgrade_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ var _ = ginkgo.Describe("EKS Cluster upgrade test", func() {
5555
namespace = shared.SetupSpecNamespace(ctx, specName, e2eCtx)
5656
clusterName = fmt.Sprintf("%s-%s", specName, util.RandomString(6))
5757

58-
initialVersion = e2eCtx.E2EConfig.GetVariable(shared.EksUpgradeFromVersion)
59-
upgradeToVersion = e2eCtx.E2EConfig.GetVariable(shared.EksUpgradeToVersion)
58+
initialVersion = e2eCtx.E2EConfig.MustGetVariable(shared.EksUpgradeFromVersion)
59+
upgradeToVersion = e2eCtx.E2EConfig.MustGetVariable(shared.EksUpgradeToVersion)
6060

6161
ginkgo.By("default iam role should exist")
6262
VerifyRoleExistsAndOwned(ekscontrolplanev1.DefaultEKSControlPlaneRole, clusterName, false, e2eCtx.BootstrapUserAWSSession)

test/e2e/suites/unmanaged/helpers_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ func defaultConfigCluster(clusterName, namespace string) clusterctl.ConfigCluste
9797
Flavor: clusterctl.DefaultFlavor,
9898
Namespace: namespace,
9999
ClusterName: clusterName,
100-
KubernetesVersion: e2eCtx.E2EConfig.GetVariable(shared.KubernetesVersion),
100+
KubernetesVersion: e2eCtx.E2EConfig.MustGetVariable(shared.KubernetesVersion),
101101
ControlPlaneMachineCount: ptr.To[int64](1),
102102
WorkerMachineCount: ptr.To[int64](0),
103103
}
@@ -303,7 +303,7 @@ func makeMachineDeployment(namespace, mdName, clusterName string, az *string, re
303303
Name: mdName,
304304
Namespace: namespace,
305305
},
306-
Version: ptr.To[string](e2eCtx.E2EConfig.GetVariable(shared.KubernetesVersion)),
306+
Version: ptr.To[string](e2eCtx.E2EConfig.MustGetVariable(shared.KubernetesVersion)),
307307
},
308308
},
309309
},

0 commit comments

Comments
 (0)