Skip to content

Commit

Permalink
add upgrade from 1.1 to current
Browse files Browse the repository at this point in the history
  • Loading branch information
mboukhalfa committed Mar 27, 2023
1 parent 1147c37 commit bc0a03e
Show file tree
Hide file tree
Showing 6 changed files with 105 additions and 2 deletions.
4 changes: 2 additions & 2 deletions clusterctl-settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
"name": "infrastructure-metal3",
"config": {
"componentsFile": "infrastructure-components.yaml",
"nextVersion": "v1.4.0"
"nextVersion": "v1.4.99"
}
}
}
21 changes: 21 additions & 0 deletions test/e2e/data/infrastructure-metal3/v1.1/metadata.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
apiVersion: clusterctl.cluster.x-k8s.io/v1alpha3
kind: Metadata
releaseSeries:
- major: 1
minor: 4
contract: v1beta1
- major: 1
minor: 3
contract: v1beta1
- major: 1
minor: 2
contract: v1beta1
- major: 1
minor: 1
contract: v1beta1
- major: 1
minor: 0
contract: v1beta1
- major: 0
minor: 5
contract: v1alpha4
File renamed without changes.
24 changes: 24 additions & 0 deletions test/e2e/data/shared/v1.1/metadata.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
apiVersion: clusterctl.cluster.x-k8s.io/v1alpha3
kind: Metadata
releaseSeries:
- major: 1
minor: 4
contract: v1beta1
- major: 1
minor: 3
contract: v1beta1
- major: 1
minor: 2
contract: v1beta1
- major: 1
minor: 1
contract: v1beta1
- major: 1
minor: 0
contract: v1beta1
- major: 0
minor: 4
contract: v1alpha4
- major: 0
minor: 3
contract: v1alpha3
24 changes: 24 additions & 0 deletions test/e2e/data/shared/v1.4/metadata.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
apiVersion: clusterctl.cluster.x-k8s.io/v1alpha3
kind: Metadata
releaseSeries:
- major: 1
minor: 4
contract: v1beta1
- major: 1
minor: 3
contract: v1beta1
- major: 1
minor: 2
contract: v1beta1
- major: 1
minor: 1
contract: v1beta1
- major: 1
minor: 0
contract: v1beta1
- major: 0
minor: 4
contract: v1alpha4
- major: 0
minor: 3
contract: v1alpha3
34 changes: 34 additions & 0 deletions test/e2e/upgrade_management_cluster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,40 @@ import (

const workDir = "/opt/metal3-dev-env/"

var _ = Describe("When testing cluster upgrade v1.1 > current [upgrade]", func() {
BeforeEach(func() {
osType := strings.ToLower(os.Getenv("OS"))
Expect(osType).ToNot(Equal(""))
validateGlobals(specName)
imageURL, imageChecksum := EnsureImage(e2eConfig.GetVariable("INIT_WITH_KUBERNETES_VERSION"))
os.Setenv("IMAGE_RAW_CHECKSUM", imageChecksum)
os.Setenv("IMAGE_RAW_URL", imageURL)
// We need to override clusterctl apply log folder to avoid getting our credentials exposed.
clusterctlLogFolder = filepath.Join(os.TempDir(), "clusters", bootstrapClusterProxy.GetName())
})

capi_e2e.ClusterctlUpgradeSpec(ctx, func() capi_e2e.ClusterctlUpgradeSpecInput {
return capi_e2e.ClusterctlUpgradeSpecInput{
E2EConfig: e2eConfig,
ClusterctlConfigPath: clusterctlConfigPath,
BootstrapClusterProxy: bootstrapClusterProxy,
ArtifactFolder: artifactFolder,
SkipCleanup: skipCleanup,
InitWithCoreProvider: fmt.Sprintf("capi-system/cluster-api:%s", os.Getenv("CAPI_FROM_RELEASE")),
InitWithBootstrapProviders: []string{fmt.Sprintf("capi-kubeadm-bootstrap-system/kubeadm:%s", os.Getenv("CAPI_FROM_RELEASE"))},
InitWithControlPlaneProviders: []string{fmt.Sprintf("capi-kubeadm-control-plane-system/kubeadm:%s", os.Getenv("CAPI_FROM_RELEASE"))},
InitWithInfrastructureProviders: []string{fmt.Sprintf("capm3-system/metal3:%s", os.Getenv("CAPM3_FROM_RELEASE"))},
InitWithBinary: e2eConfig.GetVariable("INIT_WITH_BINARY"),
PreInit: preInitFunc,
PreWaitForCluster: preWaitForCluster,
PreUpgrade: preUpgrade,
PreCleanupManagementCluster: preCleanupManagementCluster,
MgmtFlavor: osType,
WorkloadFlavor: osType,
}
})
})

var _ = Describe("When testing cluster upgrade v1alpha5 > current [upgrade]", func() {
BeforeEach(func() {
osType := strings.ToLower(os.Getenv("OS"))
Expand Down

0 comments on commit bc0a03e

Please sign in to comment.