Skip to content

Commit 64bc0d8

Browse files
committed
Add env variables for infrastructure provider and contract
1 parent c550787 commit 64bc0d8

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,8 @@ E2E_FIREWALL_SIZE ?= "v1-small-x86"
139139
E2E_FIREWALL_NETWORKS ?= "internet-mini-lab"
140140
ARTIFACTS ?= "$(PWD)/_artifacts"
141141
E2E_DEFAULT_FLAVOR ?= "calico"
142+
E2E_INFRASTRUCTURE_PROVIDER ?= "metal-stack"
143+
E2E_INFRASTRUCTURE_PROVIDER_CONTRACT ?= "v1beta2"
142144
# Can be something like: basic && !move
143145
E2E_LABEL_FILTER ?= ""
144146

@@ -168,6 +170,8 @@ test-e2e: manifests generate fmt vet build ginkgo kustomize
168170
FIREWALL_NETWORKS=$(E2E_FIREWALL_NETWORKS) \
169171
ARTIFACTS=$(ARTIFACTS) \
170172
E2E_DEFAULT_FLAVOR=$(E2E_DEFAULT_FLAVOR) \
173+
INFRASTRUCTURE_PROVIDER=$(E2E_INFRASTRUCTURE_PROVIDER) \
174+
INFRASTRUCTURE_PROVIDER_CONTRACT=$(E2E_INFRASTRUCTURE_PROVIDER_CONTRACT) \
171175
KUBETEST_CONFIGURATION="$(shell git rev-parse --show-toplevel)/test/e2e/frmwrk/data/kubetest/conformance.yaml" \
172176
$(GINKGO) -vv -r --junit-report="junit.e2e_suite.xml" --output-dir="$(ARTIFACTS)" --label-filter="$(E2E_LABEL_FILTER)" -timeout 120m ./test/e2e/frmwrk
173177

test/e2e/frmwrk/shared_context.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,8 @@ func withDefaultEnvironment() Option {
106106
e2e.Environment.controlPlaneMachineImagePrefix = e2e.envOrVar("E2E_CONTROL_PLANE_MACHINE_IMAGE_PREFIX")
107107
e2e.Environment.workerMachineImagePrefix = e2e.envOrVar("E2E_WORKER_MACHINE_IMAGE_PREFIX")
108108
e2e.Environment.Flavor = e2e.envOrVar("E2E_DEFAULT_FLAVOR")
109+
e2e.Environment.infrastructureProvider = e2e.envOrVar("INFRASTRUCTURE_PROVIDER")
110+
e2e.Environment.infrastructureProviderContract = e2e.envOrVar("INFRASTRUCTURE_PROVIDER_CONTRACT")
109111

110112
_ = e2e.envOrVar("CONTROL_PLANE_MACHINE_SIZE")
111113
_ = e2e.envOrVar("WORKER_MACHINE_SIZE")
@@ -138,6 +140,8 @@ type Environment struct {
138140
publicNetwork string
139141
kubeconfigPath string
140142
artifactsPath string
143+
infrastructureProvider string
144+
infrastructureProviderContract string
141145
}
142146

143147
func (ee *E2EContext) ProvideBootstrapCluster() {
@@ -209,7 +213,7 @@ func (ee *E2EContext) InitManagementCluster(ctx context.Context) {
209213
ClusterProxy: ee.Environment.Bootstrap,
210214
ClusterctlConfigPath: ee.Environment.ClusterctlConfigPath,
211215
LogFolder: path.Join(ee.Environment.artifactsPath, "clusters", "bootstrap"),
212-
InfrastructureProviders: ee.E2EConfig.GetProviderLatestVersionsByContract("v1beta2", "metal-stack"),
216+
InfrastructureProviders: ee.E2EConfig.GetProviderLatestVersionsByContract(ee.Environment.infrastructureProviderContract, ee.Environment.infrastructureProvider),
213217
AddonProviders: ee.E2EConfig.GetProviderLatestVersionsByContract("v1beta2", clusterctlconfig.HelmAddonProviderName),
214218
BootstrapProviders: ee.E2EConfig.GetProviderLatestVersionsByContract("v1beta2", clusterctlconfig.KubeadmBootstrapProviderName),
215219
ControlPlaneProviders: ee.E2EConfig.GetProviderLatestVersionsByContract("v1beta2", clusterctlconfig.KubeadmControlPlaneProviderName),

0 commit comments

Comments
 (0)