Skip to content

Commit 0b8055d

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 0b8055d

File tree

2 files changed

+53
-0
lines changed

2 files changed

+53
-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: 38 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,39 @@ 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+
})
123+
124+
capi_e2e.ClusterctlUpgradeSpec(context.TODO(), func() capi_e2e.ClusterctlUpgradeSpecInput {
125+
return capi_e2e.ClusterctlUpgradeSpecInput{
126+
E2EConfig: e2eCtx.E2EConfig,
127+
ClusterctlConfigPath: e2eCtx.Environment.ClusterctlConfigPath,
128+
BootstrapClusterProxy: e2eCtx.Environment.BootstrapClusterProxy,
129+
ArtifactFolder: e2eCtx.Settings.ArtifactFolder,
130+
SkipCleanup: false,
131+
InitWithBinary: "https://github.com/kubernetes-sigs/cluster-api/releases/download/" + capiRelease111 + "/clusterctl-{OS}-{ARCH}",
132+
InitWithProvidersContract: "v1beta1",
133+
InitWithInfrastructureProviders: []string{"openstack:" + capoRelease013},
134+
InitWithCoreProvider: "cluster-api:v1.11.0",
135+
InitWithBootstrapProviders: []string{"kubeadm:v1.11.0"},
136+
InitWithControlPlaneProviders: []string{"kubeadm:v1.11.0"},
137+
MgmtFlavor: shared.FlavorDefault,
138+
WorkloadFlavor: shared.FlavorDefault,
139+
InitWithKubernetesVersion: e2eCtx.E2EConfig.MustGetVariable(shared.KubernetesVersion),
140+
InitWithRuntimeExtensionProviders: []string{"openstack-resource-controller:v1.0.2"},
141+
}
142+
})
143+
})

0 commit comments

Comments
 (0)