Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions test/e2e/data/e2e_conf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,15 @@ providers:
files:
- sourcePath: "../data/shared/capi/metadata.yaml"
# For clusterctl upgrade test
- name: v1.11.0
value: "https://github.com/kubernetes-sigs/cluster-api/releases/download/v1.11.0/core-components.yaml"
type: "url"
contract: v1beta2
replacements:
- old: --metrics-addr=127.0.0.1:8080
new: --metrics-addr=:8080
files:
- sourcePath: "../data/shared/capi/metadata.yaml"
- name: "{go://sigs.k8s.io/[email protected]}"
value: "https://github.com/kubernetes-sigs/cluster-api/releases/download/{go://sigs.k8s.io/[email protected]}/core-components.yaml"
type: url
Expand All @@ -51,6 +60,15 @@ providers:
files:
- sourcePath: "../data/shared/capi/metadata.yaml"
# For clusterctl upgrade test
- name: v1.11.0
value: "https://github.com/kubernetes-sigs/cluster-api/releases/download/v1.11.0/bootstrap-components.yaml"
type: "url"
contract: v1beta2
replacements:
- old: --metrics-addr=127.0.0.1:8080
new: --metrics-addr=:8080
files:
- sourcePath: "../data/shared/capi/metadata.yaml"
- name: "{go://sigs.k8s.io/[email protected]}"
value: "https://github.com/kubernetes-sigs/cluster-api/releases/download/{go://sigs.k8s.io/[email protected]}/bootstrap-components.yaml"
type: url
Expand All @@ -75,6 +93,15 @@ providers:
files:
- sourcePath: "../data/shared/capi/metadata.yaml"
# For clusterctl upgrade test
- name: v1.11.0
value: "https://github.com/kubernetes-sigs/cluster-api/releases/download/v1.11.0/control-plane-components.yaml"
type: "url"
contract: v1beta2
replacements:
- old: --metrics-addr=127.0.0.1:8080
new: --metrics-addr=:8080
files:
- sourcePath: "../data/shared/capi/metadata.yaml"
- name: "{go://sigs.k8s.io/[email protected]}"
value: "https://github.com/kubernetes-sigs/cluster-api/releases/download/{go://sigs.k8s.io/[email protected]}/control-plane-components.yaml"
type: url
Expand Down Expand Up @@ -119,6 +146,21 @@ providers:
new: "--v=4"
- old: "--leader-elect"
new: "--leader-elect=false\n - --sync-period=1m"
# This is only for clusterctl upgrade tests
- name: "{go://github.com/kubernetes-sigs/[email protected]}"
value: "https://github.com/kubernetes-sigs/cluster-api-provider-openstack/releases/download/{go://github.com/kubernetes-sigs/[email protected]}/infrastructure-components.yaml"
type: url
contract: v1beta2
files:
- sourcePath: "../data/shared/provider/metadata.yaml"
- sourcePath: "./infrastructure-openstack-no-artifact/cluster-template.yaml"
replacements:
- old: "imagePullPolicy: Always"
new: "imagePullPolicy: IfNotPresent"
- old: "--v=2"
new: "--v=4"
- old: "--leader-elect"
new: "--leader-elect=false\n - --sync-period=1m"
- name: v0.13.99
value: ../../../config/default
# This is the upcoming version.
Expand Down
36 changes: 36 additions & 0 deletions test/e2e/suites/e2e/clusterctl_upgrade_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ import (
var (
capoRelease011 string
capoRelease012 string
capoRelease013 string
capiRelease110 string
capiRelease111 string
)

var _ = Describe("When testing clusterctl upgrades for CAPO (v0.11=>current) and ORC (v1.0.2=>current) [clusterctl-upgrade]", func() {
Expand Down Expand Up @@ -103,3 +105,37 @@ var _ = Describe("When testing clusterctl upgrades for CAPO (v0.12=>current) and
}
})
})

var _ = Describe("When testing clusterctl upgrades for CAPO (v0.13=>current) and ORC (v1.0.2=>current)[clusterctl-upgrade]", func() {
BeforeEach(func(ctx context.Context) {
setDownloadE2EImageEnvVar()
// Note: This gives the version without the 'v' prefix, so we need to add it below.
capoRelease013, err = clusterctl.ResolveRelease(ctx, "go://github.com/kubernetes-sigs/[email protected]")
Expect(err).ToNot(HaveOccurred(), "failed to get stable release of CAPO")
capoRelease013 = "v" + capoRelease013
// We need CAPI v1.11 here for clusterctl init with the v1beta2 contract.
// This is hard-coded to the .0 release because the test will fail if there are no
// newer patch releases to upgrade to.
capiRelease111 = "v1.11.0"
})

capi_e2e.ClusterctlUpgradeSpec(context.TODO(), func() capi_e2e.ClusterctlUpgradeSpecInput {
return capi_e2e.ClusterctlUpgradeSpecInput{
E2EConfig: e2eCtx.E2EConfig,
ClusterctlConfigPath: e2eCtx.Environment.ClusterctlConfigPath,
BootstrapClusterProxy: e2eCtx.Environment.BootstrapClusterProxy,
ArtifactFolder: e2eCtx.Settings.ArtifactFolder,
SkipCleanup: false,
InitWithBinary: "https://github.com/kubernetes-sigs/cluster-api/releases/download/" + capiRelease111 + "/clusterctl-{OS}-{ARCH}",
InitWithProvidersContract: "v1beta1",
InitWithInfrastructureProviders: []string{"openstack:" + capoRelease013},
InitWithCoreProvider: "cluster-api:" + capiRelease111,
InitWithBootstrapProviders: []string{"kubeadm:" + capiRelease111},
InitWithControlPlaneProviders: []string{"kubeadm:" + capiRelease111},
MgmtFlavor: shared.FlavorDefault,
WorkloadFlavor: shared.FlavorDefault,
InitWithKubernetesVersion: e2eCtx.E2EConfig.MustGetVariable(shared.KubernetesVersion),
InitWithRuntimeExtensionProviders: []string{"openstack-resource-controller:v1.0.2"},
}
})
})