Skip to content

Commit

Permalink
Refactor test data to align with core CAPI
Browse files Browse the repository at this point in the history
Signed-off-by: killianmuldoon <[email protected]>
  • Loading branch information
killianmuldoon committed Aug 17, 2023
1 parent 0d36621 commit 85aa4ca
Show file tree
Hide file tree
Showing 40 changed files with 72 additions and 905 deletions.
13 changes: 7 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,16 @@
/clusterctl
/cluster-api-provider-vsphere*

# Generated files
/cluster-api-provider-vsphere
# Examples
/examples/provider-components/provider-components*.yaml
test/e2e/data/infrastructure-vsphere/kustomization/base/cluster-template.yaml
test/e2e/data/infrastructure-vsphere/kustomization/topology/cluster-template-topology.yaml
test/e2e/data/infrastructure-vsphere/cluster-template*.yaml
test/e2e/data/infrastructure-vsphere/clusterclass-quick-start.yaml

# E2E test artifacts folder
_artifacts/

# E2E test templates
test/e2e/data/infrastructure-vsphere/main/**/cluster-template*.yaml
test/e2e/data/infrastructure-vsphere/main/clusterclass-quick-start.yaml

# env vars file used in getting-started.md and manifests generation
envvars.txt

Expand Down
44 changes: 26 additions & 18 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -289,27 +289,31 @@ generate-doctoc:

.PHONY: generate-e2e-templates
generate-e2e-templates: ## Generate e2e cluster templates
$(MAKE) release-flavors

cp $(RELEASE_DIR)/cluster-template.yaml $(E2E_TEMPLATE_DIR)/kustomization/base/cluster-template.yaml
"$(KUSTOMIZE)" --load-restrictor LoadRestrictionsNone build $(E2E_TEMPLATE_DIR)/kustomization/base > $(E2E_TEMPLATE_DIR)/cluster-template.yaml
"$(KUSTOMIZE)" --load-restrictor LoadRestrictionsNone build $(E2E_TEMPLATE_DIR)/kustomization/hw-upgrade > $(E2E_TEMPLATE_DIR)/cluster-template-hw-upgrade.yaml
"$(KUSTOMIZE)" --load-restrictor LoadRestrictionsNone build $(E2E_TEMPLATE_DIR)/kustomization/storage-policy > $(E2E_TEMPLATE_DIR)/cluster-template-storage-policy.yaml
"$(KUSTOMIZE)" --load-restrictor LoadRestrictionsNone build $(E2E_TEMPLATE_DIR)/kustomization/remote-management > $(E2E_TEMPLATE_DIR)/cluster-template-remote-management.yaml
"$(KUSTOMIZE)" --load-restrictor LoadRestrictionsNone build $(E2E_TEMPLATE_DIR)/kustomization/conformance > $(E2E_TEMPLATE_DIR)/cluster-template-conformance.yaml
generate-e2e-templates: $(KUSTOMIZE) $(addprefix generate-e2e-templates-, main)

.PHONY: generate-e2e-templates-main
generate-e2e-templates-main: $(KUSTOMIZE)
$(MAKE) release-flavors-main

cp $(RELEASE_DIR)/main/cluster-template.yaml $(E2E_TEMPLATE_DIR)/main/base/cluster-template.yaml
"$(KUSTOMIZE)" --load-restrictor LoadRestrictionsNone build $(E2E_TEMPLATE_DIR)/main/base > $(E2E_TEMPLATE_DIR)/main/cluster-template.yaml
"$(KUSTOMIZE)" --load-restrictor LoadRestrictionsNone build $(E2E_TEMPLATE_DIR)/main/hw-upgrade > $(E2E_TEMPLATE_DIR)/main/cluster-template-hw-upgrade.yaml
"$(KUSTOMIZE)" --load-restrictor LoadRestrictionsNone build $(E2E_TEMPLATE_DIR)/main/storage-policy > $(E2E_TEMPLATE_DIR)/main/cluster-template-storage-policy.yaml
"$(KUSTOMIZE)" --load-restrictor LoadRestrictionsNone build $(E2E_TEMPLATE_DIR)/main/remote-management > $(E2E_TEMPLATE_DIR)/main/cluster-template-remote-management.yaml
"$(KUSTOMIZE)" --load-restrictor LoadRestrictionsNone build $(E2E_TEMPLATE_DIR)/main/conformance > $(E2E_TEMPLATE_DIR)/main/cluster-template-conformance.yaml
# Since CAPI uses different flavor names for KCP and MD remediation using MHC
"$(KUSTOMIZE)" --load-restrictor LoadRestrictionsNone build $(E2E_TEMPLATE_DIR)/kustomization/mhc-remediation/kcp > $(E2E_TEMPLATE_DIR)/cluster-template-kcp-remediation.yaml
"$(KUSTOMIZE)" --load-restrictor LoadRestrictionsNone build $(E2E_TEMPLATE_DIR)/kustomization/mhc-remediation/md > $(E2E_TEMPLATE_DIR)/cluster-template-md-remediation.yaml
"$(KUSTOMIZE)" --load-restrictor LoadRestrictionsNone build $(E2E_TEMPLATE_DIR)/kustomization/node-drain > $(E2E_TEMPLATE_DIR)/cluster-template-node-drain.yaml
"$(KUSTOMIZE)" --load-restrictor LoadRestrictionsNone build $(E2E_TEMPLATE_DIR)/kustomization/ignition > $(E2E_TEMPLATE_DIR)/cluster-template-ignition.yaml
"$(KUSTOMIZE)" --load-restrictor LoadRestrictionsNone build $(E2E_TEMPLATE_DIR)/main/mhc-remediation/kcp > $(E2E_TEMPLATE_DIR)/main/cluster-template-kcp-remediation.yaml
"$(KUSTOMIZE)" --load-restrictor LoadRestrictionsNone build $(E2E_TEMPLATE_DIR)/main/mhc-remediation/md > $(E2E_TEMPLATE_DIR)/main/cluster-template-md-remediation.yaml
"$(KUSTOMIZE)" --load-restrictor LoadRestrictionsNone build $(E2E_TEMPLATE_DIR)/main/node-drain > $(E2E_TEMPLATE_DIR)/main/cluster-template-node-drain.yaml
"$(KUSTOMIZE)" --load-restrictor LoadRestrictionsNone build $(E2E_TEMPLATE_DIR)/main/ignition > $(E2E_TEMPLATE_DIR)/main/cluster-template-ignition.yaml
# generate clusterclass and cluster topology
cp $(RELEASE_DIR)/cluster-template-topology.yaml $(E2E_TEMPLATE_DIR)/kustomization/topology/cluster-template-topology.yaml
cp $(RELEASE_DIR)/clusterclass-template.yaml $(E2E_TEMPLATE_DIR)/clusterclass-quick-start.yaml
"$(KUSTOMIZE)" --load-restrictor LoadRestrictionsNone build $(E2E_TEMPLATE_DIR)/kustomization/topology > $(E2E_TEMPLATE_DIR)/cluster-template-topology.yaml
cp $(RELEASE_DIR)/main/cluster-template-topology.yaml $(E2E_TEMPLATE_DIR)/main/topology/cluster-template-topology.yaml
cp $(RELEASE_DIR)/main/clusterclass-template.yaml $(E2E_TEMPLATE_DIR)/main/clusterclass-quick-start.yaml
"$(KUSTOMIZE)" --load-restrictor LoadRestrictionsNone build $(E2E_TEMPLATE_DIR)/main/topology > $(E2E_TEMPLATE_DIR)/main/cluster-template-topology.yaml
# for PCI passthrough template
"$(KUSTOMIZE)" --load-restrictor LoadRestrictionsNone build $(E2E_TEMPLATE_DIR)/kustomization/pci > $(E2E_TEMPLATE_DIR)/cluster-template-pci.yaml
"$(KUSTOMIZE)" --load-restrictor LoadRestrictionsNone build $(E2E_TEMPLATE_DIR)/main/pci > $(E2E_TEMPLATE_DIR)/main/cluster-template-pci.yaml
# for DHCP overrides
"$(KUSTOMIZE)" --load-restrictor LoadRestrictionsNone build $(E2E_TEMPLATE_DIR)/kustomization/dhcp-overrides > $(E2E_TEMPLATE_DIR)/cluster-template-dhcp-overrides.yaml
"$(KUSTOMIZE)" --load-restrictor LoadRestrictionsNone build $(E2E_TEMPLATE_DIR)/main/dhcp-overrides > $(E2E_TEMPLATE_DIR)/main/cluster-template-dhcp-overrides.yaml


## --------------------------------------
Expand Down Expand Up @@ -529,7 +533,7 @@ IMAGE_REVIEWERS ?= $(shell ./hack/get-project-maintainers.sh)

.PHONY: $(RELEASE_DIR)
$(RELEASE_DIR):
mkdir -p $(RELEASE_DIR)/
mkdir -p $(RELEASE_DIR)/main

.PHONY: $(RELEASE_NOTES_DIR)
$(RELEASE_NOTES_DIR):
Expand Down Expand Up @@ -598,6 +602,10 @@ release-manifests: $(BUILD_DIR) $(MANIFEST_DIR) $(KUSTOMIZE) $(STAGE)-flavors ##
release-flavors: $(RELEASE_DIR)
$(MAKE) generate-flavors FLAVOR_DIR=$(RELEASE_DIR)

.PHONY: release-flavors-main ## Create release flavor manifests
release-flavors-main: $(RELEASE_DIR)
$(MAKE) generate-flavors FLAVOR_DIR=$(RELEASE_DIR)/main

.PHONY: dev-flavors ## Create release flavor manifests
dev-flavors: $(OVERRIDES_DIR)
$(MAKE) generate-flavors FLAVOR_DIR=$(OVERRIDES_DIR)
Expand Down
4 changes: 2 additions & 2 deletions docs/release/release-tasks.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ This comes down to changing occurrences of the old version to the new version, e
3. Adjust `metadata.yaml`'s:
1. Add new release to the top-level `metadata.yaml`
2. Create a new `v1.7` `metadata.yaml` (`test/e2e/data/shared/v1.7/metadata.yaml`) by copying
`test/e2e/data/shared/main/metadata.yaml`
3. Add the new v1.8 release to the main `metadata.yaml` (`test/e2e/data/shared/main/metadata.yaml`).
`test/e2e/data/shared/metadata.yaml`
3. Add the new v1.8 release to the main `metadata.yaml` (`test/e2e/data/shared/metadata.yaml`).
4. Remove old `metadata.yaml`'s that are not used anymore in clusterctl upgrade tests.
4. Adjust cluster templates in `test/e2e/data/infrastructure-vsphere`:
1. Create a new `v1.7` folder. It should be created based on the `main` folder and only contain the templates
Expand Down
1 change: 1 addition & 0 deletions test/e2e/capi_clusterctl_upgrade_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (
capi_e2e "sigs.k8s.io/cluster-api/test/e2e"
)

// Note: This test is skipped through the use of PContext instead of Describe.
var _ = PContext("ClusterAPI Upgrade Tests [clusterctl-Upgrade]", func() {
Describe("Upgrading cluster from v1alpha4 to v1beta1 using clusterctl", func() {
capi_e2e.ClusterctlUpgradeSpec(context.Background(), func() capi_e2e.ClusterctlUpgradeSpecInput {
Expand Down
30 changes: 15 additions & 15 deletions test/e2e/config/vsphere-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,9 @@ providers:
type: "url"
contract: v1alpha4
files:
- sourcePath: "../../../test/e2e/data/infrastructure-vsphere/capi-upgrades/v1alpha4/cluster-template.yaml"
- sourcePath: "../../../test/e2e/data/infrastructure-vsphere/v0.8/cluster-template.yaml"
- sourcePath: "../../../metadata.yaml"
- name: v1.7.0
- name: v1.8.99
# Use manifest from source files
value: ../../../../cluster-api-provider-vsphere/config/default
contract: v1beta1
Expand All @@ -115,19 +115,19 @@ providers:
new: "imagePullPolicy: IfNotPresent"
files:
# Add a cluster template
- sourcePath: "../../../test/e2e/data/infrastructure-vsphere/cluster-template.yaml"
- sourcePath: "../../../test/e2e/data/infrastructure-vsphere/cluster-template-conformance.yaml"
- sourcePath: "../../../test/e2e/data/infrastructure-vsphere/cluster-template-hw-upgrade.yaml"
- sourcePath: "../../../test/e2e/data/infrastructure-vsphere/cluster-template-kcp-remediation.yaml"
- sourcePath: "../../../test/e2e/data/infrastructure-vsphere/cluster-template-md-remediation.yaml"
- sourcePath: "../../../test/e2e/data/infrastructure-vsphere/cluster-template-node-drain.yaml"
- sourcePath: "../../../test/e2e/data/infrastructure-vsphere/cluster-template-pci.yaml"
- sourcePath: "../../../test/e2e/data/infrastructure-vsphere/cluster-template-remote-management.yaml"
- sourcePath: "../../../test/e2e/data/infrastructure-vsphere/cluster-template-storage-policy.yaml"
- sourcePath: "../../../test/e2e/data/infrastructure-vsphere/cluster-template-topology.yaml"
- sourcePath: "../../../test/e2e/data/infrastructure-vsphere/cluster-template-dhcp-overrides.yaml"
- sourcePath: "../../../test/e2e/data/infrastructure-vsphere/clusterclass-quick-start.yaml"
- sourcePath: "../../../test/e2e/data/infrastructure-vsphere/cluster-template-ignition.yaml"
- sourcePath: "../../../test/e2e/data/infrastructure-vsphere/main/cluster-template.yaml"
- sourcePath: "../../../test/e2e/data/infrastructure-vsphere/main/cluster-template-conformance.yaml"
- sourcePath: "../../../test/e2e/data/infrastructure-vsphere/main/cluster-template-hw-upgrade.yaml"
- sourcePath: "../../../test/e2e/data/infrastructure-vsphere/main/cluster-template-kcp-remediation.yaml"
- sourcePath: "../../../test/e2e/data/infrastructure-vsphere/main/cluster-template-md-remediation.yaml"
- sourcePath: "../../../test/e2e/data/infrastructure-vsphere/main/cluster-template-node-drain.yaml"
- sourcePath: "../../../test/e2e/data/infrastructure-vsphere/main/cluster-template-pci.yaml"
- sourcePath: "../../../test/e2e/data/infrastructure-vsphere/main/cluster-template-remote-management.yaml"
- sourcePath: "../../../test/e2e/data/infrastructure-vsphere/main/cluster-template-storage-policy.yaml"
- sourcePath: "../../../test/e2e/data/infrastructure-vsphere/main/cluster-template-topology.yaml"
- sourcePath: "../../../test/e2e/data/infrastructure-vsphere/main/cluster-template-dhcp-overrides.yaml"
- sourcePath: "../../../test/e2e/data/infrastructure-vsphere/main/clusterclass-quick-start.yaml"
- sourcePath: "../../../test/e2e/data/infrastructure-vsphere/main/cluster-template-ignition.yaml"
- sourcePath: "../data/shared/v1beta1_provider/metadata.yaml"

variables:
Expand Down
30 changes: 15 additions & 15 deletions test/e2e/config/vsphere-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,9 @@ providers:
type: "url"
contract: v1alpha4
files:
- sourcePath: "../../../test/e2e/data/infrastructure-vsphere/capi-upgrades/v1alpha4/cluster-template.yaml"
- sourcePath: "../../../test/e2e/data/infrastructure-vsphere/v0.8/cluster-template.yaml"
- sourcePath: "../../../metadata.yaml"
- name: v1.7.0
- name: v1.8.99
# Use manifest from source files
value: ../../../../cluster-api-provider-vsphere/config/default
contract: v1beta1
Expand All @@ -118,19 +118,19 @@ providers:
new: "imagePullPolicy: IfNotPresent"
files:
# Add a cluster template
- sourcePath: "../../../test/e2e/data/infrastructure-vsphere/cluster-template.yaml"
- sourcePath: "../../../test/e2e/data/infrastructure-vsphere/cluster-template-conformance.yaml"
- sourcePath: "../../../test/e2e/data/infrastructure-vsphere/cluster-template-hw-upgrade.yaml"
- sourcePath: "../../../test/e2e/data/infrastructure-vsphere/cluster-template-kcp-remediation.yaml"
- sourcePath: "../../../test/e2e/data/infrastructure-vsphere/cluster-template-md-remediation.yaml"
- sourcePath: "../../../test/e2e/data/infrastructure-vsphere/cluster-template-node-drain.yaml"
- sourcePath: "../../../test/e2e/data/infrastructure-vsphere/cluster-template-pci.yaml"
- sourcePath: "../../../test/e2e/data/infrastructure-vsphere/cluster-template-remote-management.yaml"
- sourcePath: "../../../test/e2e/data/infrastructure-vsphere/cluster-template-storage-policy.yaml"
- sourcePath: "../../../test/e2e/data/infrastructure-vsphere/cluster-template-topology.yaml"
- sourcePath: "../../../test/e2e/data/infrastructure-vsphere/cluster-template-dhcp-overrides.yaml"
- sourcePath: "../../../test/e2e/data/infrastructure-vsphere/clusterclass-quick-start.yaml"
- sourcePath: "../../../test/e2e/data/infrastructure-vsphere/cluster-template-ignition.yaml"
- sourcePath: "../../../test/e2e/data/infrastructure-vsphere/main/cluster-template.yaml"
- sourcePath: "../../../test/e2e/data/infrastructure-vsphere/main/cluster-template-conformance.yaml"
- sourcePath: "../../../test/e2e/data/infrastructure-vsphere/main/cluster-template-hw-upgrade.yaml"
- sourcePath: "../../../test/e2e/data/infrastructure-vsphere/main/cluster-template-kcp-remediation.yaml"
- sourcePath: "../../../test/e2e/data/infrastructure-vsphere/main/cluster-template-md-remediation.yaml"
- sourcePath: "../../../test/e2e/data/infrastructure-vsphere/main/cluster-template-node-drain.yaml"
- sourcePath: "../../../test/e2e/data/infrastructure-vsphere/main/cluster-template-pci.yaml"
- sourcePath: "../../../test/e2e/data/infrastructure-vsphere/main/cluster-template-remote-management.yaml"
- sourcePath: "../../../test/e2e/data/infrastructure-vsphere/main/cluster-template-storage-policy.yaml"
- sourcePath: "../../../test/e2e/data/infrastructure-vsphere/main/cluster-template-topology.yaml"
- sourcePath: "../../../test/e2e/data/infrastructure-vsphere/main/cluster-template-dhcp-overrides.yaml"
- sourcePath: "../../../test/e2e/data/infrastructure-vsphere/main/clusterclass-quick-start.yaml"
- sourcePath: "../../../test/e2e/data/infrastructure-vsphere/main/cluster-template-ignition.yaml"
- sourcePath: "../data/shared/v1beta1_provider/metadata.yaml"

variables:
Expand Down
113 changes: 0 additions & 113 deletions test/e2e/data/cni/kindnet/kindnet.yaml

This file was deleted.

Loading

0 comments on commit 85aa4ca

Please sign in to comment.