@@ -50,6 +50,7 @@ E2E_DATA_DIR ?= $(ROOT_DIR)/test/e2e/data
5050KUBETEST_CONF_PATH ?= $(abspath $(E2E_DATA_DIR ) /kubetest/conformance.yaml)
5151KUBETEST_WINDOWS_CONF_PATH ?= $(abspath $(E2E_DATA_DIR ) /kubetest/upstream-windows.yaml)
5252KUBETEST_REPO_LIST_PATH ?= $(abspath $(E2E_DATA_DIR ) /kubetest/repo-list.yaml)
53+ AZURE_TEMPLATES := $(E2E_DATA_DIR ) /infrastructure-azure
5354
5455# set --output-base used for conversion-gen which needs to be different for in GOPATH and outside GOPATH dev
5556ifneq ($(abspath $(ROOT_DIR ) ) ,$(GOPATH ) /src/sigs.k8s.io/cluster-api-provider-azure)
@@ -168,7 +169,7 @@ test-cover: envs-test $(KUBECTL) $(KUBE_APISERVER) $(ETCD) ## Run tests with cod
168169 go tool cover -html=coverage.out -o coverage.html
169170
170171.PHONY : test-e2e-run
171- test-e2e-run : $(ENVSUBST ) $(KUBECTL ) $(GINKGO ) # # Run e2e tests
172+ test-e2e-run : generate-e2e-templates $(ENVSUBST ) $(KUBECTL ) $(GINKGO ) # # Run e2e tests
172173 $(ENVSUBST ) < $(E2E_CONF_FILE ) > $(E2E_CONF_FILE_ENVSUBST ) && \
173174 $(GINKGO) -v -trace -tags=e2e -focus="$(GINKGO_FOCUS)" -skip="$(GINKGO_SKIP)" -nodes=$(GINKGO_NODES) --noColor=$(GINKGO_NOCOLOR) $(GINKGO_ARGS) ./test/e2e -- \
174175 -e2e.artifacts-folder="$(ARTIFACTS)" \
@@ -289,6 +290,7 @@ generate: ## Generate code
289290 $(MAKE ) generate-go
290291 $(MAKE ) generate-manifests
291292 $(MAKE ) generate-flavors
293+ $(MAKE ) generate-e2e-templates
292294
293295.PHONY : generate-go
294296generate-go : $(CONTROLLER_GEN ) $(MOCKGEN ) $(CONVERSION_GEN ) # # Runs Go related generate targets
@@ -328,6 +330,19 @@ generate-manifests: $(CONTROLLER_GEN) ## Generate manifests e.g. CRD, RBAC etc.
328330generate-flavors : $(KUSTOMIZE )
329331 ./hack/gen-flavors.sh
330332
333+ .PHONY : generate-e2e-templates # # Generate Azure infrastructure templates for the v1alpha4 CAPI test suite.
334+ generate-e2e-templates : $(KUSTOMIZE )
335+ $(KUSTOMIZE ) build $(AZURE_TEMPLATES ) /v1alpha4/cluster-template --load-restrictor LoadRestrictionsNone > $(AZURE_TEMPLATES ) /v1alpha4/cluster-template.yaml
336+ $(KUSTOMIZE ) build $(AZURE_TEMPLATES ) /v1alpha4/cluster-template-md-remediation --load-restrictor LoadRestrictionsNone > $(AZURE_TEMPLATES ) /v1alpha4/cluster-template-md-remediation.yaml
337+ $(KUSTOMIZE ) build $(AZURE_TEMPLATES ) /v1alpha4/cluster-template-kcp-remediation --load-restrictor LoadRestrictionsNone > $(AZURE_TEMPLATES ) /v1alpha4/cluster-template-kcp-remediation.yaml
338+ $(KUSTOMIZE ) build $(AZURE_TEMPLATES ) /v1alpha4/cluster-template-kcp-adoption/step1 --load-restrictor LoadRestrictionsNone > $(AZURE_TEMPLATES ) /v1alpha4/cluster-template-kcp-adoption.yaml
339+ echo " ---" >> $(AZURE_TEMPLATES ) /v1alpha4/cluster-template-kcp-adoption.yaml
340+ $(KUSTOMIZE ) build $(AZURE_TEMPLATES ) /v1alpha4/cluster-template-kcp-adoption/step2 --load-restrictor LoadRestrictionsNone >> $(AZURE_TEMPLATES ) /v1alpha4/cluster-template-kcp-adoption.yaml
341+ $(KUSTOMIZE ) build $(AZURE_TEMPLATES ) /v1alpha4/cluster-template-machine-pool --load-restrictor LoadRestrictionsNone > $(AZURE_TEMPLATES ) /v1alpha4/cluster-template-machine-pool.yaml
342+ $(KUSTOMIZE ) build $(AZURE_TEMPLATES ) /v1alpha4/cluster-template-node-drain --load-restrictor LoadRestrictionsNone > $(AZURE_TEMPLATES ) /v1alpha4/cluster-template-node-drain.yaml
343+ $(KUSTOMIZE ) build $(AZURE_TEMPLATES ) /v1alpha4/cluster-template-upgrades --load-restrictor LoadRestrictionsNone > $(AZURE_TEMPLATES ) /v1alpha4/cluster-template-upgrades.yaml
344+ $(KUSTOMIZE ) build $(AZURE_TEMPLATES ) /v1alpha4/cluster-template-kcp-scale-in --load-restrictor LoadRestrictionsNone > $(AZURE_TEMPLATES ) /v1alpha4/cluster-template-kcp-scale-in.yaml
345+
331346# # --------------------------------------
332347# # Docker
333348# # --------------------------------------
0 commit comments