File tree Expand file tree Collapse file tree 7 files changed +96
-5
lines changed Expand file tree Collapse file tree 7 files changed +96
-5
lines changed Original file line number Diff line number Diff line change 15
15
# limitations under the License.
16
16
17
17
# ###############################################################################
18
- # usage: ci-conformance .sh
19
- # This program runs the clusterctl conformance e2e tests.
18
+ # usage: ci-e2e .sh
19
+ # This program runs the e2e tests.
20
20
# ###############################################################################
21
21
22
22
set -x
84
84
85
85
" hack/ci/create_devstack.sh"
86
86
87
+ # Upload image for e2e clusterctl upgrade tests
88
+ source " ${REPO_ROOT} /hack/ci/${RESOURCE_TYPE} .sh"
89
+ CONTAINER_ARCHIVE=" ${ARTIFACTS} /capo-e2e-image.tar"
90
+ SSH_KEY=" $( get_ssh_private_key_file) "
91
+ SSH_ARGS=" -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o IdentitiesOnly=yes -o PasswordAuthentication=no"
92
+ CONTROLLER_IP=${CONTROLLER_IP:- " 10.0.3.15" }
93
+
94
+ make e2e-image
95
+ docker save -o " ${CONTAINER_ARCHIVE} " gcr.io/k8s-staging-capi-openstack/capi-openstack-controller:e2e
96
+ scp -i " ${SSH_KEY} " ${SSH_ARGS} " ${CONTAINER_ARCHIVE} " " cloud@${CONTROLLER_IP} :capo-e2e-image.tar"
97
+ ssh -i " ${SSH_KEY} " ${SSH_ARGS} " cloud@${CONTROLLER_IP} " -- sudo chown root:root capo-e2e-image.tar
98
+ ssh -i " ${SSH_KEY} " ${SSH_ARGS} " cloud@${CONTROLLER_IP} " -- sudo chmod u=rw,g=r,o=r capo-e2e-image.tar
99
+ ssh -i " ${SSH_KEY} " ${SSH_ARGS} " cloud@${CONTROLLER_IP} " -- sudo mv capo-e2e-image.tar /var/www/html/capo-e2e-image.tar
100
+
87
101
export OPENSTACK_CLOUD_YAML_FILE
88
102
OPENSTACK_CLOUD_YAML_FILE=" $( pwd) /clouds.yaml"
89
103
make test-e2e
Original file line number Diff line number Diff line change @@ -100,10 +100,8 @@ providers:
100
100
- sourcePath : " ./infrastructure-openstack/cluster-template-external-cloud-provider.yaml"
101
101
- sourcePath : " ./infrastructure-openstack/cluster-template-without-lb.yaml"
102
102
replacements :
103
- # TODO: We should use e2e here instead of main, but we need a way to get it into the workload cluster
104
- # for upgrade tests for that to work.
105
103
- old : gcr.io/k8s-staging-capi-openstack/capi-openstack-controller:dev
106
- new : gcr.io/k8s-staging-capi-openstack/capi-openstack-controller:main
104
+ new : gcr.io/k8s-staging-capi-openstack/capi-openstack-controller:e2e
107
105
- old : " imagePullPolicy: Always"
108
106
new : " imagePullPolicy: IfNotPresent"
109
107
- old : " --v=2"
Original file line number Diff line number Diff line change @@ -4,3 +4,4 @@ resources:
4
4
5
5
components :
6
6
- ../common-patches
7
+ - ../upgrade-patches
Original file line number Diff line number Diff line change
1
+ ---
2
+ # Workaround for https://github.com/kubernetes-sigs/cluster-api/issues/7457
3
+ # There is a small but important difference between these two:
4
+ # path: /a/b/c
5
+ # *creates* the c array, overwriting anything that was there before
6
+ # path: /a/b/c/-
7
+ # *adds* to the c array and does not work if the array is missing
8
+ #
9
+ # We add to the postKubeadmCommands (instead of pre*) since we need the CI artifacts
10
+ # script to run first. Without this, the container images are not imported properly.
11
+ - op : add
12
+ path : /spec/kubeadmConfigSpec/postKubeadmCommands
13
+ value :
14
+ - /usr/local/bin/ci-artifacts-openstack.sh
15
+ - op : add
16
+ path : /spec/kubeadmConfigSpec/files/-
17
+ value :
18
+ content : |
19
+ #!/bin/bash
20
+ DOWNLOAD_E2E_IMAGE=${DOWNLOAD_E2E_IMAGE:=false}
21
+ if [ ! "${DOWNLOAD_E2E_IMAGE}" = true ]; then
22
+ echo "Not downloading E2E image, exiting"
23
+ exit 0
24
+ fi
25
+ # Download the locally built CAPO controller image
26
+ echo "Downloading ${E2E_IMAGE_URL}"
27
+ wget "${E2E_IMAGE_URL}" -O "/tmp/capo-controller-manager.tar"
28
+ sudo ctr -n k8s.io images import "/tmp/capo-controller-manager.tar" || echo "* ignoring expected 'ctr images import' result"
29
+ owner : root:root
30
+ path : /usr/local/bin/ci-artifacts-openstack.sh
31
+ permissions : " 0750"
Original file line number Diff line number Diff line change
1
+ ---
2
+ # Workaround for https://github.com/kubernetes-sigs/cluster-api/issues/7457
3
+ # There is a small but important difference between these two:
4
+ # path: /a/b/c
5
+ # *creates* the c array, overwriting anything that was there before
6
+ # path: /a/b/c/-
7
+ # *adds* to the c array and does not work if the array is missing
8
+ #
9
+ # We add to the postKubeadmCommands (instead of pre*) since we need the CI artifacts
10
+ # script to run first. Without this, the container images are not imported properly.
11
+ - op : add
12
+ path : /spec/template/spec/postKubeadmCommands
13
+ value :
14
+ - /usr/local/bin/ci-artifacts-openstack.sh
15
+ - op : add
16
+ path : /spec/template/spec/files/-
17
+ value :
18
+ content : |
19
+ #!/bin/bash
20
+ DOWNLOAD_E2E_IMAGE=${DOWNLOAD_E2E_IMAGE:=false}
21
+ if [ ! "${DOWNLOAD_E2E_IMAGE}" = true ]; then
22
+ echo "Not downloading E2E image, exiting"
23
+ exit 0
24
+ fi
25
+ # Download the locally built CAPO controller image
26
+ echo "Downloading ${E2E_IMAGE_URL}"
27
+ wget "${E2E_IMAGE_URL}" -O "/tmp/capo-controller-manager.tar"
28
+ sudo ctr -n k8s.io images import "/tmp/capo-controller-manager.tar" || echo "* ignoring expected 'ctr images import' result"
29
+ owner : root:root
30
+ path : /usr/local/bin/ci-artifacts-openstack.sh
31
+ permissions : " 0750"
Original file line number Diff line number Diff line change
1
+ # Modifications to release templates for clusterctl upgrade scenarios
2
+ ---
3
+ apiVersion : kustomize.config.k8s.io/v1alpha1
4
+ kind : Component
5
+
6
+ patches :
7
+ - target :
8
+ kind : KubeadmControlPlane
9
+ name : \${CLUSTER_NAME}-control-plane
10
+ path : ci-hack-kcp.yaml
11
+ - target :
12
+ kind : KubeadmConfigTemplate
13
+ name : \${CLUSTER_NAME}-md-0
14
+ path : ci-hack-kct.yaml
Original file line number Diff line number Diff line change @@ -36,6 +36,8 @@ import (
36
36
var _ = Describe ("When testing clusterctl upgrades (v0.6=>current) [clusterctl-upgrade]" , func () {
37
37
ctx := context .TODO ()
38
38
shared .SetEnvVar ("USE_CI_ARTIFACTS" , "true" , false )
39
+ shared .SetEnvVar ("DOWNLOAD_E2E_IMAGE" , "true" , false )
40
+ shared .SetEnvVar ("E2E_IMAGE_URL" , "http://10.0.3.15/capo-e2e-image.tar" , false )
39
41
40
42
capi_e2e .ClusterctlUpgradeSpec (ctx , func () capi_e2e.ClusterctlUpgradeSpecInput {
41
43
return capi_e2e.ClusterctlUpgradeSpecInput {
You can’t perform that action at this time.
0 commit comments