Skip to content

Commit 9fbe8db

Browse files
committed
use a suite-level context for e2e tests
1 parent 2044c33 commit 9fbe8db

File tree

10 files changed

+53
-54
lines changed

10 files changed

+53
-54
lines changed

test/e2e/azure_csidriver.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ func AzureDiskCSISpec(ctx context.Context, inputGetter func() AzureDiskCSISpecIn
6565
By("[In-tree]Deploying storage class and pvc")
6666
By("Deploying managed disk storage class")
6767
scName := "managedhdd" + util.RandomString(6)
68-
e2e_sc.Create(scName).WithWaitForFirstConsumer().DeployStorageClass(clientset)
68+
e2e_sc.Create(scName).WithWaitForFirstConsumer().DeployStorageClass(ctx, clientset)
6969
By("Deploying persistent volume claim")
7070
pvcName = "dd-managed-hdd-5g" + util.RandomString(6)
7171
pvcBuilder, err := e2e_pvc.Create(pvcName, "5Gi")
@@ -74,7 +74,7 @@ func AzureDiskCSISpec(ctx context.Context, inputGetter func() AzureDiskCSISpecIn
7474
"volume.beta.kubernetes.io/storage-class": scName,
7575
}
7676
pvcBuilder.WithAnnotations(annotations)
77-
err = pvcBuilder.DeployPVC(clientset)
77+
err = pvcBuilder.DeployPVC(ctx, clientset)
7878
Expect(err).NotTo(HaveOccurred())
7979
} else {
8080
By("[External]Deploying storage class and pvc")
@@ -83,13 +83,13 @@ func AzureDiskCSISpec(ctx context.Context, inputGetter func() AzureDiskCSISpecIn
8383
e2e_sc.Create(scName).WithWaitForFirstConsumer().
8484
WithOotProvisionerName().
8585
WithOotParameters().
86-
DeployStorageClass(clientset)
86+
DeployStorageClass(ctx, clientset)
8787
By("Deploying persistent volume claim")
8888
pvcName = "oot-dd-managed-hdd-5g" + util.RandomString(6)
8989
pvcBuilder, err := e2e_pvc.Create(pvcName, "5Gi")
9090
Expect(err).NotTo(HaveOccurred())
9191
pvcBuilder.WithStorageClass(scName)
92-
err = pvcBuilder.DeployPVC(clientset)
92+
err = pvcBuilder.DeployPVC(ctx, clientset)
9393
Expect(err).NotTo(HaveOccurred())
9494
}
9595

test/e2e/azure_logcollector.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -591,7 +591,7 @@ func collectVMBootLog(ctx context.Context, vmClient *armcompute.VirtualMachinesC
591591
return errors.Wrap(err, "failed to get boot diagnostics data")
592592
}
593593

594-
return writeBootLog(bootDiagnostics.RetrieveBootDiagnosticsDataResult, outputPath)
594+
return writeBootLog(ctx, bootDiagnostics.RetrieveBootDiagnosticsDataResult, outputPath)
595595
}
596596

597597
// collectVMSSInstanceBootLog collects boot logs of the vmss instance by using azure boot diagnostics.
@@ -603,12 +603,12 @@ func collectVMSSInstanceBootLog(ctx context.Context, instanceClient *armcompute.
603603
return errors.Wrap(err, "failed to get boot diagnostics data")
604604
}
605605

606-
return writeBootLog(bootDiagnostics.RetrieveBootDiagnosticsDataResult, outputPath)
606+
return writeBootLog(ctx, bootDiagnostics.RetrieveBootDiagnosticsDataResult, outputPath)
607607
}
608608

609-
func writeBootLog(bootDiagnostics armcompute.RetrieveBootDiagnosticsDataResult, outputPath string) error {
609+
func writeBootLog(ctx context.Context, bootDiagnostics armcompute.RetrieveBootDiagnosticsDataResult, outputPath string) error {
610610
var err error
611-
req, err := http.NewRequestWithContext(context.TODO(), http.MethodGet, *bootDiagnostics.SerialConsoleLogBlobURI, http.NoBody)
611+
req, err := http.NewRequestWithContext(ctx, http.MethodGet, *bootDiagnostics.SerialConsoleLogBlobURI, http.NoBody)
612612
if err != nil {
613613
return errors.Wrap(err, "failed to create HTTP request")
614614
}

test/e2e/azure_privatecluster.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ func AzurePrivateClusterSpec(ctx context.Context, inputGetter func() AzurePrivat
113113
userID = "cloud-provider-user-identity"
114114
}
115115
resourceID := fmt.Sprintf("/subscriptions/%s/resourceGroups/%s/providers/Microsoft.ManagedIdentity/userAssignedIdentities/%s", subscriptionID, identityRG, userID)
116-
Expect(os.Setenv("UAMI_CLIENT_ID", getClientIDforMSI(resourceID))).To(Succeed())
116+
Expect(os.Setenv("UAMI_CLIENT_ID", getClientIDforMSI(ctx, resourceID))).To(Succeed())
117117

118118
Expect(os.Setenv("CLUSTER_IDENTITY_NAME", "cluster-identity-user-assigned")).To(Succeed())
119119
Expect(os.Setenv("CLUSTER_IDENTITY_NAMESPACE", input.Namespace.Name)).To(Succeed())
@@ -407,7 +407,7 @@ func SetupExistingVNet(ctx context.Context, vnetCidr string, cpSubnetCidrs, node
407407
}
408408

409409
// getClientIDforMSI fetches the client ID of a user assigned identity.
410-
func getClientIDforMSI(resourceID string) string {
410+
func getClientIDforMSI(ctx context.Context, resourceID string) string {
411411
subscriptionID := getSubscriptionID(Default)
412412
cred, err := azidentity.NewDefaultAzureCredential(nil)
413413
Expect(err).NotTo(HaveOccurred())
@@ -418,7 +418,7 @@ func getClientIDforMSI(resourceID string) string {
418418
parsed, err := azureutil.ParseResourceID(resourceID)
419419
Expect(err).NotTo(HaveOccurred())
420420

421-
resp, err := msiClient.Get(context.TODO(), parsed.ResourceGroupName, parsed.Name, nil)
421+
resp, err := msiClient.Get(ctx, parsed.ResourceGroupName, parsed.Name, nil)
422422
Expect(err).NotTo(HaveOccurred())
423423

424424
return *resp.Properties.ClientID

test/e2e/azure_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ import (
4040

4141
var _ = Describe("Workload cluster creation", func() {
4242
var (
43-
ctx = context.TODO()
4443
specName = "create-workload-cluster"
4544
namespace *corev1.Namespace
4645
cancelWatches context.CancelFunc

test/e2e/capi_test.go

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ const (
4343

4444
var _ = Describe("Running the Cluster API E2E tests", func() {
4545
var (
46-
ctx = context.TODO()
4746
specTimes = map[string]time.Time{}
4847
)
4948
BeforeEach(func() {
@@ -73,7 +72,7 @@ var _ = Describe("Running the Cluster API E2E tests", func() {
7372
})
7473

7574
Context("Running the quick-start spec", func() {
76-
capi_e2e.QuickStartSpec(context.TODO(), func() capi_e2e.QuickStartSpecInput {
75+
capi_e2e.QuickStartSpec(ctx, func() capi_e2e.QuickStartSpecInput {
7776
return capi_e2e.QuickStartSpecInput{
7877
E2EConfig: e2eConfig,
7978
ClusterctlConfigPath: clusterctlConfigPath,
@@ -88,7 +87,7 @@ var _ = Describe("Running the Cluster API E2E tests", func() {
8887
})
8988

9089
Context("Running the MachineDeployment rollout spec", func() {
91-
capi_e2e.MachineDeploymentRolloutSpec(context.TODO(), func() capi_e2e.MachineDeploymentRolloutSpecInput {
90+
capi_e2e.MachineDeploymentRolloutSpec(ctx, func() capi_e2e.MachineDeploymentRolloutSpecInput {
9291
return capi_e2e.MachineDeploymentRolloutSpecInput{
9392
E2EConfig: e2eConfig,
9493
ClusterctlConfigPath: clusterctlConfigPath,
@@ -104,7 +103,7 @@ var _ = Describe("Running the Cluster API E2E tests", func() {
104103

105104
if os.Getenv("USE_LOCAL_KIND_REGISTRY") != "true" {
106105
Context("Running the self-hosted spec", func() {
107-
SelfHostedSpec(context.TODO(), func() SelfHostedSpecInput {
106+
SelfHostedSpec(ctx, func() SelfHostedSpecInput {
108107
return SelfHostedSpecInput{
109108
E2EConfig: e2eConfig,
110109
ClusterctlConfigPath: clusterctlConfigPath,
@@ -121,7 +120,7 @@ var _ = Describe("Running the Cluster API E2E tests", func() {
121120

122121
// TODO: Add test using KCPRemediationSpec
123122
Context("Should successfully remediate unhealthy worker machines with MachineHealthCheck", func() {
124-
capi_e2e.MachineDeploymentRemediationSpec(context.TODO(), func() capi_e2e.MachineDeploymentRemediationSpecInput {
123+
capi_e2e.MachineDeploymentRemediationSpec(ctx, func() capi_e2e.MachineDeploymentRemediationSpecInput {
125124
return capi_e2e.MachineDeploymentRemediationSpecInput{
126125
E2EConfig: e2eConfig,
127126
ClusterctlConfigPath: clusterctlConfigPath,
@@ -136,7 +135,7 @@ var _ = Describe("Running the Cluster API E2E tests", func() {
136135
})
137136

138137
Context("Should successfully exercise machine pools", func() {
139-
capi_e2e.MachinePoolSpec(context.TODO(), func() capi_e2e.MachinePoolInput {
138+
capi_e2e.MachinePoolSpec(ctx, func() capi_e2e.MachinePoolInput {
140139
return capi_e2e.MachinePoolInput{
141140
E2EConfig: e2eConfig,
142141
ClusterctlConfigPath: clusterctlConfigPath,
@@ -151,7 +150,7 @@ var _ = Describe("Running the Cluster API E2E tests", func() {
151150
})
152151

153152
Context("Should successfully scale out and scale in a MachineDeployment", func() {
154-
capi_e2e.MachineDeploymentScaleSpec(context.TODO(), func() capi_e2e.MachineDeploymentScaleSpecInput {
153+
capi_e2e.MachineDeploymentScaleSpec(ctx, func() capi_e2e.MachineDeploymentScaleSpecInput {
155154
return capi_e2e.MachineDeploymentScaleSpecInput{
156155
E2EConfig: e2eConfig,
157156
ClusterctlConfigPath: clusterctlConfigPath,
@@ -166,7 +165,7 @@ var _ = Describe("Running the Cluster API E2E tests", func() {
166165
})
167166

168167
// Context("Should successfully set and use node drain timeout", func() {
169-
// capi_e2e.NodeDrainTimeoutSpec(context.TODO(), func() capi_e2e.NodeDrainTimeoutSpecInput {
168+
// capi_e2e.NodeDrainTimeoutSpec(ctx, func() capi_e2e.NodeDrainTimeoutSpecInput {
170169
// return capi_e2e.NodeDrainTimeoutSpecInput{
171170
// E2EConfig: e2eConfig,
172171
// ClusterctlConfigPath: clusterctlConfigPath,
@@ -352,7 +351,7 @@ var _ = Describe("Running the Cluster API E2E tests", func() {
352351
})
353352

354353
Context("Running KCP upgrade in a HA cluster [K8s-Upgrade]", func() {
355-
capi_e2e.ClusterUpgradeConformanceSpec(context.TODO(), func() capi_e2e.ClusterUpgradeConformanceSpecInput {
354+
capi_e2e.ClusterUpgradeConformanceSpec(ctx, func() capi_e2e.ClusterUpgradeConformanceSpecInput {
356355
return capi_e2e.ClusterUpgradeConformanceSpecInput{
357356
E2EConfig: e2eConfig,
358357
ClusterctlConfigPath: clusterctlConfigPath,
@@ -370,7 +369,7 @@ var _ = Describe("Running the Cluster API E2E tests", func() {
370369
})
371370

372371
Context("Running KCP upgrade in a HA cluster using scale in rollout [K8s-Upgrade]", func() {
373-
capi_e2e.ClusterUpgradeConformanceSpec(context.TODO(), func() capi_e2e.ClusterUpgradeConformanceSpecInput {
372+
capi_e2e.ClusterUpgradeConformanceSpec(ctx, func() capi_e2e.ClusterUpgradeConformanceSpecInput {
374373
return capi_e2e.ClusterUpgradeConformanceSpecInput{
375374
E2EConfig: e2eConfig,
376375
ClusterctlConfigPath: clusterctlConfigPath,

test/e2e/conformance_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ import (
4343

4444
var _ = Describe("Conformance Tests", func() {
4545
var (
46-
ctx = context.TODO()
4746
cancelWatches context.CancelFunc
4847
result *clusterctl.ApplyClusterTemplateAndWaitResult
4948
clusterName string
@@ -94,7 +93,7 @@ var _ = Describe("Conformance Tests", func() {
9493
// clusters with CI artifacts or PR artifacts are based on a known CI version
9594
// PR artifacts will replace the CI artifacts during kubeadm init
9695
if useCIArtifacts || usePRArtifacts {
97-
kubernetesVersion, err = resolveCIVersion(kubernetesVersion)
96+
kubernetesVersion, err = resolveCIVersion(ctx, kubernetesVersion)
9897
Expect(err).NotTo(HaveOccurred())
9998
Expect(os.Setenv("CI_VERSION", kubernetesVersion)).To(Succeed())
10099
Expect(os.Setenv("CLOUD_PROVIDER_AZURE_LABEL", "azure-ci")).To(Succeed())

test/e2e/e2e_suite_test.go

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,10 @@ import (
4242
)
4343

4444
var (
45+
ctx = ctrl.SetupSignalHandler()
46+
4547
// watchesCtx is used in log streaming to be able to get canceld via cancelWatches after ending the test suite.
46-
watchesCtx, cancelWatches = context.WithCancel(context.Background())
48+
watchesCtx, cancelWatches = context.WithCancel(ctx)
4749
)
4850

4951
func init() {
@@ -73,16 +75,16 @@ var _ = SynchronizedBeforeSuite(func() []byte {
7375
Expect(os.MkdirAll(artifactFolder, 0o755)).To(Succeed(), "Invalid test suite argument. Can't create e2e.artifacts-folder %q", artifactFolder)
7476

7577
Byf("Loading the e2e test configuration from %q", configPath)
76-
e2eConfig = loadE2EConfig(configPath)
78+
e2eConfig = loadE2EConfig(ctx, configPath)
7779

7880
Byf("Creating a clusterctl local repository into %q", artifactFolder)
79-
clusterctlConfigPath = createClusterctlLocalRepository(e2eConfig, filepath.Join(artifactFolder, "repository"))
81+
clusterctlConfigPath = createClusterctlLocalRepository(ctx, e2eConfig, filepath.Join(artifactFolder, "repository"))
8082

8183
By("Setting up the bootstrap cluster")
82-
bootstrapClusterProvider, bootstrapClusterProxy = setupBootstrapCluster(e2eConfig, useExistingCluster)
84+
bootstrapClusterProvider, bootstrapClusterProxy = setupBootstrapCluster(ctx, e2eConfig, useExistingCluster)
8385

8486
By("Initializing the bootstrap cluster")
85-
initBootstrapCluster(bootstrapClusterProxy, e2eConfig, clusterctlConfigPath, artifactFolder)
87+
initBootstrapCluster(watchesCtx, bootstrapClusterProxy, e2eConfig, clusterctlConfigPath, artifactFolder)
8688

8789
// encode the e2e config into the byte array.
8890
var configBuf bytes.Buffer
@@ -133,20 +135,20 @@ var _ = SynchronizedAfterSuite(func() {
133135

134136
By("Tearing down the management cluster")
135137
if !skipCleanup {
136-
tearDown(bootstrapClusterProvider, bootstrapClusterProxy)
138+
tearDown(ctx, bootstrapClusterProvider, bootstrapClusterProxy)
137139
}
138140
})
139141

140-
func loadE2EConfig(configPath string) *clusterctl.E2EConfig {
141-
config := clusterctl.LoadE2EConfig(context.TODO(), clusterctl.LoadE2EConfigInput{ConfigPath: configPath})
142+
func loadE2EConfig(ctx context.Context, configPath string) *clusterctl.E2EConfig {
143+
config := clusterctl.LoadE2EConfig(ctx, clusterctl.LoadE2EConfigInput{ConfigPath: configPath})
142144
Expect(config).NotTo(BeNil(), "Failed to load E2E config from %s", configPath)
143145

144146
resolveKubernetesVersions(config)
145147

146148
return config
147149
}
148150

149-
func createClusterctlLocalRepository(config *clusterctl.E2EConfig, repositoryFolder string) string {
151+
func createClusterctlLocalRepository(ctx context.Context, config *clusterctl.E2EConfig, repositoryFolder string) string {
150152
createRepositoryInput := clusterctl.CreateRepositoryInput{
151153
E2EConfig: config,
152154
RepositoryFolder: repositoryFolder,
@@ -158,16 +160,16 @@ func createClusterctlLocalRepository(config *clusterctl.E2EConfig, repositoryFol
158160
Expect(cniPath).To(BeAnExistingFile(), "The %s variable should resolve to an existing file", capi_e2e.CNIPath)
159161
createRepositoryInput.RegisterClusterResourceSetConfigMapTransformation(cniPath, capi_e2e.CNIResources)
160162

161-
clusterctlConfig := clusterctl.CreateRepository(context.TODO(), createRepositoryInput)
163+
clusterctlConfig := clusterctl.CreateRepository(ctx, createRepositoryInput)
162164
Expect(clusterctlConfig).To(BeAnExistingFile(), "The clusterctl config file does not exists in the local repository %s", repositoryFolder)
163165
return clusterctlConfig
164166
}
165167

166-
func setupBootstrapCluster(config *clusterctl.E2EConfig, useExistingCluster bool) (bootstrap.ClusterProvider, framework.ClusterProxy) {
168+
func setupBootstrapCluster(ctx context.Context, config *clusterctl.E2EConfig, useExistingCluster bool) (bootstrap.ClusterProvider, framework.ClusterProxy) {
167169
var clusterProvider bootstrap.ClusterProvider
168170
kubeconfigPath := ""
169171
if !useExistingCluster {
170-
clusterProvider = bootstrap.CreateKindBootstrapClusterAndLoadImages(context.TODO(), bootstrap.CreateKindBootstrapClusterAndLoadImagesInput{
172+
clusterProvider = bootstrap.CreateKindBootstrapClusterAndLoadImages(ctx, bootstrap.CreateKindBootstrapClusterAndLoadImagesInput{
171173
Name: config.ManagementClusterName,
172174
RequiresDockerSock: config.HasDockerProvider(),
173175
Images: config.Images,
@@ -184,16 +186,16 @@ func setupBootstrapCluster(config *clusterctl.E2EConfig, useExistingCluster bool
184186
Name: "capz-e2e",
185187
Images: config.Images,
186188
}
187-
err := bootstrap.LoadImagesToKindCluster(context.TODO(), imagesInput)
189+
err := bootstrap.LoadImagesToKindCluster(ctx, imagesInput)
188190
Expect(err).NotTo(HaveOccurred(), "Failed to load images to the bootstrap cluster: %s", err)
189191
}
190192
clusterProxy := NewAzureClusterProxy("bootstrap", kubeconfigPath)
191193
Expect(clusterProxy).NotTo(BeNil(), "Failed to get a bootstrap cluster proxy")
192194
return clusterProvider, clusterProxy
193195
}
194196

195-
func initBootstrapCluster(bootstrapClusterProxy framework.ClusterProxy, config *clusterctl.E2EConfig, clusterctlConfig, artifactFolder string) {
196-
clusterctl.InitManagementClusterAndWatchControllerLogs(watchesCtx, clusterctl.InitManagementClusterAndWatchControllerLogsInput{
197+
func initBootstrapCluster(ctx context.Context, bootstrapClusterProxy framework.ClusterProxy, config *clusterctl.E2EConfig, clusterctlConfig, artifactFolder string) {
198+
clusterctl.InitManagementClusterAndWatchControllerLogs(ctx, clusterctl.InitManagementClusterAndWatchControllerLogsInput{
197199
ClusterProxy: bootstrapClusterProxy,
198200
ClusterctlConfigPath: clusterctlConfig,
199201
InfrastructureProviders: config.InfrastructureProviders(),
@@ -202,12 +204,12 @@ func initBootstrapCluster(bootstrapClusterProxy framework.ClusterProxy, config *
202204
}, config.GetIntervals(bootstrapClusterProxy.GetName(), "wait-controllers")...)
203205
}
204206

205-
func tearDown(bootstrapClusterProvider bootstrap.ClusterProvider, bootstrapClusterProxy framework.ClusterProxy) {
207+
func tearDown(ctx context.Context, bootstrapClusterProvider bootstrap.ClusterProvider, bootstrapClusterProxy framework.ClusterProxy) {
206208
cancelWatches()
207209
if bootstrapClusterProxy != nil {
208-
bootstrapClusterProxy.Dispose(context.TODO())
210+
bootstrapClusterProxy.Dispose(ctx)
209211
}
210212
if bootstrapClusterProvider != nil {
211-
bootstrapClusterProvider.Dispose(context.TODO())
213+
bootstrapClusterProvider.Dispose(ctx)
212214
}
213215
}

test/e2e/helpers.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -615,12 +615,12 @@ func validateStableReleaseString(stableVersion string) (isStable bool, matches [
615615

616616
// resolveCIVersion resolves kubernetes version labels (e.g. latest, latest-1.xx) to the corresponding CI version numbers.
617617
// Go implementation of https://github.com/kubernetes-sigs/cluster-api/blob/d1dc87d5df3ab12a15ae5b63e50541a191b7fec4/scripts/ci-e2e-lib.sh#L75-L95.
618-
func resolveCIVersion(label string) (string, error) {
618+
func resolveCIVersion(ctx context.Context, label string) (string, error) {
619619
if ciVersion, ok := os.LookupEnv("CI_VERSION"); ok {
620620
return ciVersion, nil
621621
}
622622
if strings.HasPrefix(label, "latest") {
623-
if kubernetesVersion, err := latestCIVersion(label); err == nil {
623+
if kubernetesVersion, err := latestCIVersion(ctx, label); err == nil {
624624
return kubernetesVersion, nil
625625
}
626626
}
@@ -630,9 +630,9 @@ func resolveCIVersion(label string) (string, error) {
630630
}
631631

632632
// latestCIVersion returns the latest CI version of a given label in the form of latest-1.xx.
633-
func latestCIVersion(label string) (string, error) {
633+
func latestCIVersion(ctx context.Context, label string) (string, error) {
634634
ciVersionURL := fmt.Sprintf("https://dl.k8s.io/ci/%s.txt", label)
635-
req, err := http.NewRequestWithContext(context.TODO(), http.MethodGet, ciVersionURL, http.NoBody)
635+
req, err := http.NewRequestWithContext(ctx, http.MethodGet, ciVersionURL, http.NoBody)
636636
if err != nil {
637637
return "", err
638638
}
@@ -690,10 +690,10 @@ func resolveKubetestRepoListPath(version string, path string) (string, error) {
690690

691691
// resolveKubernetesVersions looks at Kubernetes versions set as variables in the e2e config and sets them to a valid k8s version
692692
// that has an existing capi offer image available. For example, if the version is "stable-1.22", the function will set it to the latest 1.22 version that has a published reference image.
693-
func resolveKubernetesVersions(config *clusterctl.E2EConfig) {
694-
linuxVersions := getVersionsInCommunityGallery(context.TODO(), os.Getenv(AzureLocation), capiCommunityGallery, "capi-ubun2-2404")
695-
windowsVersions := getVersionsInCommunityGallery(context.TODO(), os.Getenv(AzureLocation), capiCommunityGallery, "capi-win-2019-containerd")
696-
flatcarK8sVersions := getFlatcarK8sVersions(context.TODO(), os.Getenv(AzureLocation), flatcarCAPICommunityGallery)
693+
func resolveKubernetesVersions(ctx context.Context, config *clusterctl.E2EConfig) {
694+
linuxVersions := getVersionsInCommunityGallery(ctx, os.Getenv(AzureLocation), capiCommunityGallery, "capi-ubun2-2404")
695+
windowsVersions := getVersionsInCommunityGallery(ctx, os.Getenv(AzureLocation), capiCommunityGallery, "capi-win-2019-containerd")
696+
flatcarK8sVersions := getFlatcarK8sVersions(ctx, os.Getenv(AzureLocation), flatcarCAPICommunityGallery)
697697

698698
// find the intersection of ubuntu and windows versions available, since we need an image for both.
699699
var versions semver.Versions

test/e2e/kubernetes/pvc/pvc.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,9 @@ func (b *Builder) WithStorageClass(scName string) *Builder {
109109
return b
110110
}
111111

112-
func (b *Builder) DeployPVC(clientset *kubernetes.Clientset) error {
112+
func (b *Builder) DeployPVC(ctx context.Context, clientset *kubernetes.Clientset) error {
113113
Eventually(func(g Gomega) {
114-
_, err := clientset.CoreV1().PersistentVolumeClaims("default").Create(context.TODO(), b.pvc, metav1.CreateOptions{})
114+
_, err := clientset.CoreV1().PersistentVolumeClaims("default").Create(ctx, b.pvc, metav1.CreateOptions{})
115115
if err != nil {
116116
log.Printf("Error trying to deploy storage class %s in namespace %s:%s\n", b.pvc.Name, b.pvc.ObjectMeta.Namespace, err.Error())
117117
}

0 commit comments

Comments
 (0)