Skip to content

Commit a66fb0c

Browse files
authored
Merge pull request #457 from ykakarap/e2e_spec_files
generate e2e spec files at runtime
2 parents 6af7001 + 0042a4d commit a66fb0c

File tree

11 files changed

+63
-2513
lines changed

11 files changed

+63
-2513
lines changed

scripts/e2e/bootstrap_job.template

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,6 @@ spec:
1515
env:
1616
- name: CLUSTERCTL_VERSION
1717
value: ${VERSION}
18-
- name: TARGET_VM_PREFIX
19-
valueFrom:
20-
secretKeyRef:
21-
name: clusterapi-provider-vsphere-ci-secret
22-
key: target-vm-prefix
2318
- name: TARGET_VM_SSH
2419
valueFrom:
2520
secretKeyRef:
@@ -30,31 +25,11 @@ spec:
3025
secretKeyRef:
3126
name: clusterapi-provider-vsphere-ci-secret
3227
key: target-vm-ssh-pub
33-
- name: VSPHERE_CONTROLLER_VERSION
34-
valueFrom:
35-
secretKeyRef:
36-
name: clusterapi-provider-vsphere-ci-secret
37-
key: vsphere-controller-version
3828
- name: PROVIDER_COMPONENT_SPEC
3929
valueFrom:
4030
secretKeyRef:
4131
name: clusterapi-provider-vsphere-ci-secret
4232
key: provider-component-spec
43-
- name: VSPHERE_SERVER
44-
valueFrom:
45-
secretKeyRef:
46-
name: clusterapi-provider-vsphere-ci-secret
47-
key: vsphere-server
48-
- name: VSPHERE_USERNAME
49-
valueFrom:
50-
secretKeyRef:
51-
name: clusterapi-provider-vsphere-ci-secret
52-
key: vsphere-username
53-
- name: VSPHERE_PASSWORD
54-
valueFrom:
55-
secretKeyRef:
56-
name: clusterapi-provider-vsphere-ci-secret
57-
key: vsphere-password
5833
- name: BOOTSTRAP_KUBECONFIG
5934
valueFrom:
6035
secretKeyRef:

scripts/e2e/bootstrap_job/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ FROM ${BASE_IMAGE}
1616
LABEL maintainer="Hui Luo <[email protected]>"
1717

1818
COPY *.sh /clusterapi/
19-
COPY spec /clusterapi/spec
19+
COPY out/e2e-cluster /clusterapi/spec
2020

2121
WORKDIR /clusterapi/
2222
CMD ["shell"]

scripts/e2e/bootstrap_job/Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ REGISTRY ?=gcr.io/cluster-api-provider-vsphere/pr/ci
66
all: build
77
.PHONY : all
88

9-
.PHONY : copyspec
10-
copyspec:
11-
cp ../../../cmd/clusterctl/examples/vsphere/addons.yaml.template ./spec/addons.template
9+
.PHONY: genspec
10+
genspec:
11+
../generate-e2e-spec.sh
1212

1313
.PHONY : build
14-
build: copyspec
14+
build: genspec
1515
docker build . --tag $(REGISTRY):$(VERSION)
1616

1717
push: build

scripts/e2e/bootstrap_job/clusterctl.sh

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,6 @@
1818
# bootstrap need be created beforehand.
1919

2020
# specs requires following enviroments variables:
21-
# VSPHERE_SERVER
22-
# VSPHERE_USERNAME
23-
# VSPHERE_PASSWORD
24-
# VSPHERE_CONTROLLER_VERSION
25-
# TARGET_VM_PREFIX
2621
# TARGET_VM_SSH (base64 encoded)
2722
# TARGET_VM_SSH_PUB (base64 encoded)
2823
# BOOTSTRAP_KUBECONFIG
@@ -42,9 +37,6 @@ TARGET_VM_SSH_PUB=$(echo -n "${TARGET_VM_SSH_PUB}" | base64 -w 0)
4237
export TARGET_VM_SSH TARGET_VM_SSH_PUB
4338
echo "${TARGET_VM_SSH_PUB}"
4439

45-
for filename in spec/*.template; do
46-
envsubst >"${filename//template/yml}" <"$filename"
47-
done
4840

4941
# download kubectl binary
5042
retry=20
@@ -69,10 +61,10 @@ chmod +x /usr/local/bin/clusterctl
6961

7062
# run clusterctl
7163
echo "test ${PROVIDER_COMPONENT_SPEC}"
72-
clusterctl create cluster -e ~/.kube/config -c ./spec/cluster.yml \
73-
-m ./spec/machines.yml \
64+
clusterctl create cluster -e ~/.kube/config -c ./spec/cluster.yaml \
65+
-m ./spec/machines.yaml \
7466
-p ./spec/"${PROVIDER_COMPONENT_SPEC}" \
75-
-a ./spec/addons.yml \
67+
-a ./spec/addons.yaml \
7668
--provider vsphere \
7769
-v 6
7870

scripts/e2e/bootstrap_job/spec/cluster.template

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

scripts/e2e/bootstrap_job/spec/machines.template

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

scripts/e2e/bootstrap_job/spec/machineset.template

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

0 commit comments

Comments
 (0)