Skip to content

Commit 96f02b7

Browse files
Refactor test data to align with core CAPI
Signed-off-by: killianmuldoon <[email protected]>
1 parent 00a675b commit 96f02b7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+90
-1971
lines changed

.gitignore

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,16 @@
88
/clusterctl
99
/cluster-api-provider-vsphere*
1010

11-
# Generated files
12-
/cluster-api-provider-vsphere
11+
# Examples
1312
/examples/provider-components/provider-components*.yaml
14-
test/e2e/data/infrastructure-vsphere/kustomization/base/cluster-template.yaml
15-
test/e2e/data/infrastructure-vsphere/kustomization/topology/cluster-template-topology.yaml
16-
test/e2e/data/infrastructure-vsphere/cluster-template*.yaml
17-
test/e2e/data/infrastructure-vsphere/clusterclass-quick-start.yaml
13+
14+
# E2E test artifacts folder
1815
_artifacts/
1916

17+
# E2E test templates
18+
test/e2e/data/infrastructure-vsphere/**/cluster-template*.yaml
19+
test/e2e/data/infrastructure-vsphere/main/clusterclass-quick-start.yaml
20+
2021
# env vars file used in getting-started.md and manifests generation
2122
envvars.txt
2223

Makefile

Lines changed: 30 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -288,28 +288,30 @@ generate-doctoc:
288288
TRACE=$(TRACE) ./hack/generate-doctoc.sh
289289

290290
.PHONY: generate-e2e-templates
291-
generate-e2e-templates: $(KUSTOMIZE) ## Generate e2e cluster templates
292-
$(MAKE) release-flavors
293-
294-
cp $(RELEASE_DIR)/cluster-template.yaml $(E2E_TEMPLATE_DIR)/kustomization/base/cluster-template.yaml
295-
"$(KUSTOMIZE)" --load-restrictor LoadRestrictionsNone build $(E2E_TEMPLATE_DIR)/kustomization/base > $(E2E_TEMPLATE_DIR)/cluster-template.yaml
296-
"$(KUSTOMIZE)" --load-restrictor LoadRestrictionsNone build $(E2E_TEMPLATE_DIR)/kustomization/hw-upgrade > $(E2E_TEMPLATE_DIR)/cluster-template-hw-upgrade.yaml
297-
"$(KUSTOMIZE)" --load-restrictor LoadRestrictionsNone build $(E2E_TEMPLATE_DIR)/kustomization/storage-policy > $(E2E_TEMPLATE_DIR)/cluster-template-storage-policy.yaml
298-
"$(KUSTOMIZE)" --load-restrictor LoadRestrictionsNone build $(E2E_TEMPLATE_DIR)/kustomization/remote-management > $(E2E_TEMPLATE_DIR)/cluster-template-remote-management.yaml
299-
"$(KUSTOMIZE)" --load-restrictor LoadRestrictionsNone build $(E2E_TEMPLATE_DIR)/kustomization/conformance > $(E2E_TEMPLATE_DIR)/cluster-template-conformance.yaml
291+
generate-e2e-templates: $(KUSTOMIZE) $(addprefix generate-e2e-templates-, main) ## Generate test templates for all branches
292+
293+
.PHONY: generate-e2e-templates-main
294+
generate-e2e-templates-main: $(KUSTOMIZE) ## Generate test templates for the main branch
295+
$(MAKE) e2e-flavors-main
296+
cp $(RELEASE_DIR)/main/cluster-template.yaml $(E2E_TEMPLATE_DIR)/main/base/cluster-template.yaml
297+
"$(KUSTOMIZE)" --load-restrictor LoadRestrictionsNone build $(E2E_TEMPLATE_DIR)/main/base > $(E2E_TEMPLATE_DIR)/main/cluster-template.yaml
298+
"$(KUSTOMIZE)" --load-restrictor LoadRestrictionsNone build $(E2E_TEMPLATE_DIR)/main/hw-upgrade > $(E2E_TEMPLATE_DIR)/main/cluster-template-hw-upgrade.yaml
299+
"$(KUSTOMIZE)" --load-restrictor LoadRestrictionsNone build $(E2E_TEMPLATE_DIR)/main/storage-policy > $(E2E_TEMPLATE_DIR)/main/cluster-template-storage-policy.yaml
300+
"$(KUSTOMIZE)" --load-restrictor LoadRestrictionsNone build $(E2E_TEMPLATE_DIR)/main/remote-management > $(E2E_TEMPLATE_DIR)/main/cluster-template-remote-management.yaml
301+
"$(KUSTOMIZE)" --load-restrictor LoadRestrictionsNone build $(E2E_TEMPLATE_DIR)/main/conformance > $(E2E_TEMPLATE_DIR)/main/cluster-template-conformance.yaml
300302
# Since CAPI uses different flavor names for KCP and MD remediation using MHC
301-
"$(KUSTOMIZE)" --load-restrictor LoadRestrictionsNone build $(E2E_TEMPLATE_DIR)/kustomization/mhc-remediation/kcp > $(E2E_TEMPLATE_DIR)/cluster-template-kcp-remediation.yaml
302-
"$(KUSTOMIZE)" --load-restrictor LoadRestrictionsNone build $(E2E_TEMPLATE_DIR)/kustomization/mhc-remediation/md > $(E2E_TEMPLATE_DIR)/cluster-template-md-remediation.yaml
303-
"$(KUSTOMIZE)" --load-restrictor LoadRestrictionsNone build $(E2E_TEMPLATE_DIR)/kustomization/node-drain > $(E2E_TEMPLATE_DIR)/cluster-template-node-drain.yaml
304-
"$(KUSTOMIZE)" --load-restrictor LoadRestrictionsNone build $(E2E_TEMPLATE_DIR)/kustomization/ignition > $(E2E_TEMPLATE_DIR)/cluster-template-ignition.yaml
303+
"$(KUSTOMIZE)" --load-restrictor LoadRestrictionsNone build $(E2E_TEMPLATE_DIR)/main/mhc-remediation/kcp > $(E2E_TEMPLATE_DIR)/main/cluster-template-kcp-remediation.yaml
304+
"$(KUSTOMIZE)" --load-restrictor LoadRestrictionsNone build $(E2E_TEMPLATE_DIR)/main/mhc-remediation/md > $(E2E_TEMPLATE_DIR)/main/cluster-template-md-remediation.yaml
305+
"$(KUSTOMIZE)" --load-restrictor LoadRestrictionsNone build $(E2E_TEMPLATE_DIR)/main/node-drain > $(E2E_TEMPLATE_DIR)/main/cluster-template-node-drain.yaml
306+
"$(KUSTOMIZE)" --load-restrictor LoadRestrictionsNone build $(E2E_TEMPLATE_DIR)/main/ignition > $(E2E_TEMPLATE_DIR)/main/cluster-template-ignition.yaml
305307
# generate clusterclass and cluster topology
306-
cp $(RELEASE_DIR)/cluster-template-topology.yaml $(E2E_TEMPLATE_DIR)/kustomization/topology/cluster-template-topology.yaml
307-
cp $(RELEASE_DIR)/clusterclass-template.yaml $(E2E_TEMPLATE_DIR)/clusterclass-quick-start.yaml
308-
"$(KUSTOMIZE)" --load-restrictor LoadRestrictionsNone build $(E2E_TEMPLATE_DIR)/kustomization/topology > $(E2E_TEMPLATE_DIR)/cluster-template-topology.yaml
308+
cp $(RELEASE_DIR)/main/cluster-template-topology.yaml $(E2E_TEMPLATE_DIR)/main/topology/cluster-template-topology.yaml
309+
cp $(RELEASE_DIR)/main/clusterclass-template.yaml $(E2E_TEMPLATE_DIR)/main/clusterclass-quick-start.yaml
310+
"$(KUSTOMIZE)" --load-restrictor LoadRestrictionsNone build $(E2E_TEMPLATE_DIR)/main/topology > $(E2E_TEMPLATE_DIR)/main/cluster-template-topology.yaml
309311
# for PCI passthrough template
310-
"$(KUSTOMIZE)" --load-restrictor LoadRestrictionsNone build $(E2E_TEMPLATE_DIR)/kustomization/pci > $(E2E_TEMPLATE_DIR)/cluster-template-pci.yaml
312+
"$(KUSTOMIZE)" --load-restrictor LoadRestrictionsNone build $(E2E_TEMPLATE_DIR)/main/pci > $(E2E_TEMPLATE_DIR)/main/cluster-template-pci.yaml
311313
# for DHCP overrides
312-
"$(KUSTOMIZE)" --load-restrictor LoadRestrictionsNone build $(E2E_TEMPLATE_DIR)/kustomization/dhcp-overrides > $(E2E_TEMPLATE_DIR)/cluster-template-dhcp-overrides.yaml
314+
"$(KUSTOMIZE)" --load-restrictor LoadRestrictionsNone build $(E2E_TEMPLATE_DIR)/main/dhcp-overrides > $(E2E_TEMPLATE_DIR)/main/cluster-template-dhcp-overrides.yaml
313315

314316

315317
## --------------------------------------
@@ -598,10 +600,19 @@ release-manifests: $(BUILD_DIR) $(MANIFEST_DIR) $(KUSTOMIZE) $(STAGE)-flavors ##
598600
release-flavors: $(RELEASE_DIR)
599601
$(MAKE) generate-flavors FLAVOR_DIR=$(RELEASE_DIR)
600602

601-
.PHONY: dev-flavors ## Create release flavor manifests
603+
.PHONY: dev-flavors ## Create dev flavor manifests
602604
dev-flavors: $(OVERRIDES_DIR)
603605
$(MAKE) generate-flavors FLAVOR_DIR=$(OVERRIDES_DIR)
604606

607+
.PHONY: e2e-flavors ## Create dev flavor manifests for e2e testing
608+
e2e-flavors: $(KUSTOMIZE) $(addprefix e2e-flavors-, main)
609+
610+
.PHONY: e2e-flavors-main ## Create dev flavor manifests for e2e testing for main branch
611+
e2e-flavors-main: $(RELEASE_DIR)
612+
mkdir -p $(RELEASE_DIR)/main
613+
$(MAKE) generate-flavors FLAVOR_DIR=$(RELEASE_DIR)/main
614+
615+
605616
.PHONY: generate-flavors
606617
generate-flavors: $(FLAVOR_DIR)
607618
go run ./packaging/flavorgen --output-dir $(FLAVOR_DIR)

docs/release/release-tasks.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,17 @@ This comes down to changing occurrences of the old version to the new version, e
2828

2929
1. Setup E2E tests for the new release:
3030
1. Goal is that our clusterctl upgrade tests are testing the right versions. For `v1.8` this means:
31+
- v1beta1: `v1.8` (will change with each new release)
3132
- v1beta1: `v1.7` (will change with each new release)
32-
- v1alpha4: `v0.8`
3333
2. Update providers in `vsphere-ci.yaml`, `vsphere-dev.yaml`, `integration-dev.yaml`:
3434
1. Add a new `v1.7.0` entry.
3535
2. Remove providers that are not used anymore in clusterctl upgrade tests.
3636
3. Change `v1.7.99` to `v1.8.99`.
3737
3. Adjust `metadata.yaml`'s:
3838
1. Add new release to the top-level `metadata.yaml`
39-
2. Create a new `v1.7` `metadata.yaml` (`test/e2e/data/shared/v1.7/metadata.yaml`) by copying
40-
`test/e2e/data/shared/main/metadata.yaml`
41-
3. Add the new v1.8 release to the main `metadata.yaml` (`test/e2e/data/shared/main/metadata.yaml`).
39+
2. Create a new `v1.7` `metadata.yaml` (`test/e2e/data/shared/v1.7/v1beta1_provider/metadata.yaml`) by copying
40+
`test/e2e/data/shared/main/v1beta1_provider/metadata.yaml`
41+
3. Add the new v1.8 release to the main `metadata.yaml` (`test/e2e/data/shared/main/v1beta1_provider/metadata.yaml`).
4242
4. Remove old `metadata.yaml`'s that are not used anymore in clusterctl upgrade tests.
4343
4. Adjust cluster templates in `test/e2e/data/infrastructure-vsphere`:
4444
1. Create a new `v1.7` folder. It should be created based on the `main` folder and only contain the templates

test/e2e/capi_clusterctl_upgrade_test.go

Lines changed: 0 additions & 41 deletions
This file was deleted.

test/e2e/config/vsphere-ci.yaml

Lines changed: 18 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -28,83 +28,49 @@ providers:
2828
- name: cluster-api
2929
type: CoreProvider
3030
versions:
31-
- name: v0.4.7 # latest published release in the v1alpha4 series; this is used for v1alpha4 --> v1beta1 clusterctl upgrades test only.
32-
contract: v1alpha4
33-
value: "https://github.com/kubernetes-sigs/cluster-api/releases/download/v0.4.7/core-components.yaml"
34-
type: "url"
35-
files:
36-
- sourcePath: "../data/shared/v1beta1/metadata.yaml"
37-
replacements:
38-
- old: "imagePullPolicy: Always"
39-
new: "imagePullPolicy: IfNotPresent"
4031
- name: v1.5.0
4132
# Use manifest from source files
4233
value: "https://github.com/kubernetes-sigs/cluster-api/releases/download/v1.5.0/core-components.yaml"
4334
type: "url"
4435
contract: v1beta1
4536
files:
46-
- sourcePath: "../data/shared/v1beta1/metadata.yaml"
37+
- sourcePath: "../data/shared/main/v1beta1/metadata.yaml"
4738
replacements:
4839
- old: "imagePullPolicy: Always"
4940
new: "imagePullPolicy: IfNotPresent"
5041

5142
- name: kubeadm
5243
type: BootstrapProvider
5344
versions:
54-
- name: v0.4.7 # latest published release in the v1alpha4 series; this is used for v1alpha4 --> v1beta1 clusterctl upgrades test only.
55-
value: "https://github.com/kubernetes-sigs/cluster-api/releases/download/v0.4.7/bootstrap-components.yaml"
56-
type: "url"
57-
contract: v1alpha4
58-
files:
59-
- sourcePath: "../data/shared/v1beta1/metadata.yaml"
60-
replacements:
61-
- old: "imagePullPolicy: Always"
62-
new: "imagePullPolicy: IfNotPresent"
6345
- name: v1.5.0
6446
# Use manifest from source files
6547
value: "https://github.com/kubernetes-sigs/cluster-api/releases/download/v1.5.0/bootstrap-components.yaml"
6648
type: "url"
6749
contract: v1beta1
6850
files:
69-
- sourcePath: "../data/shared/v1beta1/metadata.yaml"
51+
- sourcePath: "../data/shared/main/v1beta1/metadata.yaml"
7052
replacements:
7153
- old: "imagePullPolicy: Always"
7254
new: "imagePullPolicy: IfNotPresent"
7355

7456
- name: kubeadm
7557
type: ControlPlaneProvider
7658
versions:
77-
- name: v0.4.7
78-
value: "https://github.com/kubernetes-sigs/cluster-api/releases/download/v0.4.7/control-plane-components.yaml"
79-
type: "url"
80-
contract: v1alpha4
81-
files:
82-
- sourcePath: "../data/shared/v1beta1/metadata.yaml"
83-
replacements:
84-
- old: "imagePullPolicy: Always"
85-
new: "imagePullPolicy: IfNotPresent"
8659
- name: v1.5.0
8760
# Use manifest from source files
8861
value: "https://github.com/kubernetes-sigs/cluster-api/releases/download/v1.5.0/control-plane-components.yaml"
8962
type: "url"
9063
contract: v1beta1
9164
files:
92-
- sourcePath: "../data/shared/v1beta1/metadata.yaml"
65+
- sourcePath: "../data/shared/main/v1beta1/metadata.yaml"
9366
replacements:
9467
- old: "imagePullPolicy: Always"
9568
new: "imagePullPolicy: IfNotPresent"
9669

9770
- name: vsphere
9871
type: InfrastructureProvider
9972
versions:
100-
- name: v0.8.2
101-
value: https://github.com/kubernetes-sigs/cluster-api-provider-vsphere/releases/download/v0.8.2/infrastructure-components.yaml
102-
type: "url"
103-
contract: v1alpha4
104-
files:
105-
- sourcePath: "../../../test/e2e/data/infrastructure-vsphere/capi-upgrades/v1alpha4/cluster-template.yaml"
106-
- sourcePath: "../../../metadata.yaml"
107-
- name: v1.7.0
73+
- name: v1.9.99
10874
# Use manifest from source files
10975
value: ../../../../cluster-api-provider-vsphere/config/default
11076
contract: v1beta1
@@ -115,20 +81,20 @@ providers:
11581
new: "imagePullPolicy: IfNotPresent"
11682
files:
11783
# Add a cluster template
118-
- sourcePath: "../../../test/e2e/data/infrastructure-vsphere/cluster-template.yaml"
119-
- sourcePath: "../../../test/e2e/data/infrastructure-vsphere/cluster-template-conformance.yaml"
120-
- sourcePath: "../../../test/e2e/data/infrastructure-vsphere/cluster-template-hw-upgrade.yaml"
121-
- sourcePath: "../../../test/e2e/data/infrastructure-vsphere/cluster-template-kcp-remediation.yaml"
122-
- sourcePath: "../../../test/e2e/data/infrastructure-vsphere/cluster-template-md-remediation.yaml"
123-
- sourcePath: "../../../test/e2e/data/infrastructure-vsphere/cluster-template-node-drain.yaml"
124-
- sourcePath: "../../../test/e2e/data/infrastructure-vsphere/cluster-template-pci.yaml"
125-
- sourcePath: "../../../test/e2e/data/infrastructure-vsphere/cluster-template-remote-management.yaml"
126-
- sourcePath: "../../../test/e2e/data/infrastructure-vsphere/cluster-template-storage-policy.yaml"
127-
- sourcePath: "../../../test/e2e/data/infrastructure-vsphere/cluster-template-topology.yaml"
128-
- sourcePath: "../../../test/e2e/data/infrastructure-vsphere/cluster-template-dhcp-overrides.yaml"
129-
- sourcePath: "../../../test/e2e/data/infrastructure-vsphere/clusterclass-quick-start.yaml"
130-
- sourcePath: "../../../test/e2e/data/infrastructure-vsphere/cluster-template-ignition.yaml"
131-
- sourcePath: "../data/shared/v1beta1_provider/metadata.yaml"
84+
- sourcePath: "../../../test/e2e/data/infrastructure-vsphere/main/cluster-template.yaml"
85+
- sourcePath: "../../../test/e2e/data/infrastructure-vsphere/main/cluster-template-conformance.yaml"
86+
- sourcePath: "../../../test/e2e/data/infrastructure-vsphere/main/cluster-template-hw-upgrade.yaml"
87+
- sourcePath: "../../../test/e2e/data/infrastructure-vsphere/main/cluster-template-kcp-remediation.yaml"
88+
- sourcePath: "../../../test/e2e/data/infrastructure-vsphere/main/cluster-template-md-remediation.yaml"
89+
- sourcePath: "../../../test/e2e/data/infrastructure-vsphere/main/cluster-template-node-drain.yaml"
90+
- sourcePath: "../../../test/e2e/data/infrastructure-vsphere/main/cluster-template-pci.yaml"
91+
- sourcePath: "../../../test/e2e/data/infrastructure-vsphere/main/cluster-template-remote-management.yaml"
92+
- sourcePath: "../../../test/e2e/data/infrastructure-vsphere/main/cluster-template-storage-policy.yaml"
93+
- sourcePath: "../../../test/e2e/data/infrastructure-vsphere/main/cluster-template-topology.yaml"
94+
- sourcePath: "../../../test/e2e/data/infrastructure-vsphere/main/cluster-template-dhcp-overrides.yaml"
95+
- sourcePath: "../../../test/e2e/data/infrastructure-vsphere/main/clusterclass-quick-start.yaml"
96+
- sourcePath: "../../../test/e2e/data/infrastructure-vsphere/main/cluster-template-ignition.yaml"
97+
- sourcePath: "../data/shared/main/v1beta1_provider/metadata.yaml"
13298

13399
variables:
134100
KUBERNETES_VERSION: "v1.27.3"

0 commit comments

Comments
 (0)