Skip to content

Commit 7f09f4f

Browse files
committed
E2E: Cleanup upgrade patches
The naming is no longer matching the usage. These patches were originally for upgrade tests, but those tests now use kind as management cluster, and has no need to download the CAPO image in this way. However, the self-hosted test still needs this. Signed-off-by: Lennart Jern <lennart.jern@est.tech>
1 parent 33d80a2 commit 7f09f4f

File tree

7 files changed

+20
-17
lines changed

7 files changed

+20
-17
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Modifications to release templates for self-hosted scenarios.
2+
# This patch allows the nodes dowload the CAPO image from E2E_IMAGE_URL,
3+
# and load it. It is useful when testing unpublished images (e.g. a PR).
4+
# The image is downloaded only if DOWNLOAD_E2E_IMAGE is set to true
5+
# when rendering the cluster template.
6+
apiVersion: kustomize.config.k8s.io/v1alpha1
7+
kind: Component
8+
9+
patches:
10+
- path: ci-hack-kcp.yaml
11+
target:
12+
kind: KubeadmControlPlane
13+
name: \${CLUSTER_NAME}-control-plane
14+
- path: ci-hack-kct.yaml
15+
target:
16+
kind: KubeadmConfigTemplate
17+
name: \${CLUSTER_NAME}-md-0

test/e2e/data/kustomize/components/upgrade-patches/kustomization.yaml

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

test/e2e/data/kustomize/default/kustomization.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ resources:
77
components:
88
- ../components/cluster-resource-sets
99
- ../components/common
10-
- ../components/upgrade-patches
10+
- ../components/self-hosted

test/e2e/suites/e2e/clusterctl_upgrade_test.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ var (
4040

4141
var _ = Describe("When testing clusterctl upgrades for CAPO (v0.11=>current) and ORC (v1.0.2=>current) [clusterctl-upgrade]", func() {
4242
BeforeEach(func(ctx context.Context) {
43-
setDownloadE2EImageEnvVar()
4443
// Note: This gives the version without the 'v' prefix, so we need to add it below.
4544
capoRelease011, err = clusterctl.ResolveRelease(ctx, "go://github.com/kubernetes-sigs/cluster-api-provider-openstack@v0.11")
4645
Expect(err).ToNot(HaveOccurred(), "failed to get stable release of CAPO")
@@ -75,7 +74,6 @@ var _ = Describe("When testing clusterctl upgrades for CAPO (v0.11=>current) and
7574

7675
var _ = Describe("When testing clusterctl upgrades for CAPO (v0.12=>current) and ORC (v1.0.2=>current)[clusterctl-upgrade]", func() {
7776
BeforeEach(func(ctx context.Context) {
78-
setDownloadE2EImageEnvVar()
7977
// Note: This gives the version without the 'v' prefix, so we need to add it below.
8078
capoRelease012, err = clusterctl.ResolveRelease(ctx, "go://github.com/kubernetes-sigs/cluster-api-provider-openstack@v0.12")
8179
Expect(err).ToNot(HaveOccurred(), "failed to get stable release of CAPO")
@@ -110,7 +108,6 @@ var _ = Describe("When testing clusterctl upgrades for CAPO (v0.12=>current) and
110108

111109
var _ = Describe("When testing clusterctl upgrades for CAPO (v0.13=>current) and ORC (v1.0.2=>current)[clusterctl-upgrade]", func() {
112110
BeforeEach(func(ctx context.Context) {
113-
setDownloadE2EImageEnvVar()
114111
// Note: This gives the version without the 'v' prefix, so we need to add it below.
115112
capoRelease013, err = clusterctl.ResolveRelease(ctx, "go://github.com/kubernetes-sigs/cluster-api-provider-openstack@v0.13")
116113
Expect(err).ToNot(HaveOccurred(), "failed to get stable release of CAPO")

test/e2e/suites/e2e/self_hosted_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ import (
3030

3131
var _ = Describe("When testing Cluster API provider Openstack working on [self-hosted] clusters", func() {
3232
BeforeEach(func() {
33+
// The self-hosted cluster does not have the CAPO image loaded like the kind cluster does,
34+
// so we download it from E2E_IMAGE_URL.
3335
setDownloadE2EImageEnvVar()
3436
})
3537

0 commit comments

Comments
 (0)