Skip to content

Commit 7851fb6

Browse files
committed
E2E: Run clusterctl upgrade from v0.13
Add clusterctl upgrade test for v0.13. Signed-off-by: Lennart Jern <[email protected]>
1 parent 3b1a63c commit 7851fb6

File tree

2 files changed

+56
-0
lines changed

2 files changed

+56
-0
lines changed

test/e2e/data/e2e_conf.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,21 @@ providers:
119119
new: "--v=4"
120120
- old: "--leader-elect"
121121
new: "--leader-elect=false\n - --sync-period=1m"
122+
# This is only for clusterctl upgrade tests
123+
- name: "{go://github.com/kubernetes-sigs/[email protected]}"
124+
value: "https://github.com/kubernetes-sigs/cluster-api-provider-openstack/releases/download/{go://github.com/kubernetes-sigs/[email protected]}/infrastructure-components.yaml"
125+
type: url
126+
contract: v1beta2
127+
files:
128+
- sourcePath: "../data/shared/provider/metadata.yaml"
129+
- sourcePath: "./infrastructure-openstack-no-artifact/cluster-template.yaml"
130+
replacements:
131+
- old: "imagePullPolicy: Always"
132+
new: "imagePullPolicy: IfNotPresent"
133+
- old: "--v=2"
134+
new: "--v=4"
135+
- old: "--leader-elect"
136+
new: "--leader-elect=false\n - --sync-period=1m"
122137
- name: v0.13.99
123138
value: ../../../config/default
124139
# This is the upcoming version.

test/e2e/suites/e2e/clusterctl_upgrade_test.go

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@ import (
3333
var (
3434
capoRelease011 string
3535
capoRelease012 string
36+
capoRelease013 string
3637
capiRelease110 string
38+
capiRelease111 string
3739
)
3840

3941
var _ = Describe("When testing clusterctl upgrades for CAPO (v0.11=>current) and ORC (v1.0.2=>current) [clusterctl-upgrade]", func() {
@@ -103,3 +105,42 @@ var _ = Describe("When testing clusterctl upgrades for CAPO (v0.12=>current) and
103105
}
104106
})
105107
})
108+
109+
var _ = Describe("When testing clusterctl upgrades for CAPO (v0.13=>current) and ORC (v1.0.2=>current)[clusterctl-upgrade]", func() {
110+
BeforeEach(func(ctx context.Context) {
111+
setDownloadE2EImageEnvVar()
112+
// Note: This gives the version without the 'v' prefix, so we need to add it below.
113+
// The "latest-v0.13" string means that also pre-releases will be considered.
114+
capoRelease013, err = clusterctl.ResolveRelease(ctx, "go://github.com/kubernetes-sigs/[email protected]")
115+
Expect(err).ToNot(HaveOccurred(), "failed to get stable release of CAPO")
116+
capoRelease013 = "v" + capoRelease013
117+
// Note: This gives the version without the 'v' prefix, so we need to add it below
118+
// We need CAPI v1.11 here for clusterctl init with the v1beta2 contract.
119+
capiRelease111, err = capi_e2e.GetStableReleaseOfMinor(ctx, "1.11")
120+
Expect(err).ToNot(HaveOccurred(), "failed to get stable release of CAPI")
121+
capiRelease111 = "v" + capiRelease111
122+
capiRelease110, err = capi_e2e.GetStableReleaseOfMinor(ctx, "1.10")
123+
Expect(err).ToNot(HaveOccurred(), "failed to get stable release of CAPI")
124+
capiRelease110 = "v" + capiRelease110
125+
})
126+
127+
capi_e2e.ClusterctlUpgradeSpec(context.TODO(), func() capi_e2e.ClusterctlUpgradeSpecInput {
128+
return capi_e2e.ClusterctlUpgradeSpecInput{
129+
E2EConfig: e2eCtx.E2EConfig,
130+
ClusterctlConfigPath: e2eCtx.Environment.ClusterctlConfigPath,
131+
BootstrapClusterProxy: e2eCtx.Environment.BootstrapClusterProxy,
132+
ArtifactFolder: e2eCtx.Settings.ArtifactFolder,
133+
SkipCleanup: false,
134+
InitWithBinary: "https://github.com/kubernetes-sigs/cluster-api/releases/download/" + capiRelease111 + "/clusterctl-{OS}-{ARCH}",
135+
InitWithProvidersContract: "v1beta1",
136+
InitWithInfrastructureProviders: []string{"openstack:" + capoRelease013},
137+
InitWithCoreProvider: "cluster-api:" + capiRelease110,
138+
InitWithBootstrapProviders: []string{"kubeadm:" + capiRelease110},
139+
InitWithControlPlaneProviders: []string{"kubeadm:" + capiRelease110},
140+
MgmtFlavor: shared.FlavorDefault,
141+
WorkloadFlavor: shared.FlavorDefault,
142+
InitWithKubernetesVersion: e2eCtx.E2EConfig.MustGetVariable(shared.KubernetesVersion),
143+
InitWithRuntimeExtensionProviders: []string{"openstack-resource-controller:v1.0.2"},
144+
}
145+
})
146+
})

0 commit comments

Comments
 (0)