Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor E2E templates generation #810

Merged
merged 1 commit into from
Aug 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ TOOLS_DIR := hack/tools
TOOLS_BIN_DIR := $(TOOLS_DIR)/bin
GO_INSTALL = ./scripts/go_install.sh
E2E_CONF_FILE_ENVSUBST := $(REPO_ROOT)/test/e2e/config/ibmcloud-e2e-envsubst.yaml
E2E_TEMPLATES := $(REPO_ROOT)/test/e2e/data/templates

GO_APIDIFF := $(TOOLS_BIN_DIR)/go-apidiff
GOLANGCI_LINT := $(TOOLS_BIN_DIR)/golangci-lint
Expand Down Expand Up @@ -156,6 +157,10 @@ generate-go-conversions-core: $(CONVERSION_GEN)
--output-file-base=zz_generated.conversion $(CONVERSION_GEN_OUTPUT_BASE) \
--go-header-file=./hack/boilerplate/boilerplate.generatego.txt

.PHONY: generate-e2e-templates
generate-e2e-templates: $(KUSTOMIZE)
$(KUSTOMIZE) build $(E2E_TEMPLATES)/cluster-template-md-remediation --load-restrictor LoadRestrictionsNone > $(E2E_TEMPLATES)/cluster-template-md-remediation.yaml

.PHONY: modules
modules: ## Runs go mod to ensure modules are up to date
go mod tidy
Expand Down Expand Up @@ -203,7 +208,7 @@ SKIP_CREATE_MGMT_CLUSTER ?= false

# Run the end-to-end tests
.PHONY: test-e2e
test-e2e: $(GINKGO) $(KUSTOMIZE) $(ENVSUBST) set-flavor e2e-image ## Run e2e tests
test-e2e: $(GINKGO) $(KUSTOMIZE) $(ENVSUBST) set-flavor e2e-image generate-e2e-templates ## Run e2e tests
$(ENVSUBST) < $(E2E_CONF_FILE) > $(E2E_CONF_FILE_ENVSUBST)
$(GINKGO) $(GINKGO_ARGS) ./test/e2e -- \
-e2e.artifacts-folder="$(ARTIFACTS)" \
Expand Down
2 changes: 0 additions & 2 deletions test/e2e/config/ibmcloud-e2e-powervs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ providers:
files:
- sourcePath: "${PWD}/metadata.yaml"
targetName: "metadata.yaml"
- sourcePath: "${PWD}/templates/cluster-template-powervs.yaml"
targetName: "cluster-template-powervs.yaml"
- sourcePath: "${PWD}/test/e2e/data/templates/cluster-template-md-remediation.yaml"
targetName: "cluster-template-md-remediation.yaml"

Expand Down
261 changes: 0 additions & 261 deletions test/e2e/data/templates/cluster-template-md-remediation.yaml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ../../../../../templates/cluster-template-powervs.yaml
- mhc-powervs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: cluster.x-k8s.io/v1beta1
kind: MachineHealthCheck
metadata:
name: "${CLUSTER_NAME}-mhc-0"
spec:
clusterName: "${CLUSTER_NAME}"
maxUnhealthy: 100%
nodeStartupTimeout: 20m
selector:
matchLabels:
e2e.remediation.label: ""
unhealthyConditions:
- type: Ready
status: "False"
timeout: 30s