Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🌱 Update clusterctl tests for 1.9 #2242

Merged
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
2 changes: 1 addition & 1 deletion docs/e2e-test.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,8 @@ in the ephemeral cluster either before pivoting or after re-pivoting.

| tests | CAPM3 from | CAPM3 to | CAPI from | CAPI to |
| --------------| ---------------------- | --------- | --------------------- |---------------- |
| v1.9=>current | v1.9 latest patch | main | v1.9 latest patch | latest release |
| v1.8=>current | v1.8 latest patch | main | v1.8 latest patch | latest release |
| v1.7=>current | v1.7 latest patch | main | v1.7 latest patch | latest release |

<!-- markdownlint-disable MD013 -->

Expand Down
4 changes: 2 additions & 2 deletions scripts/ci-e2e.sh
Original file line number Diff line number Diff line change
Expand Up @@ -96,13 +96,13 @@ source "${M3_DEV_ENV_PATH}/lib/ironic_tls_setup.sh"

# Generate credentials
BMO_OVERLAYS=(
"${REPO_ROOT}/test/e2e/data/bmo-deployment/overlays/release-0.6"
"${REPO_ROOT}/test/e2e/data/bmo-deployment/overlays/release-0.8"
"${REPO_ROOT}/test/e2e/data/bmo-deployment/overlays/release-0.9"
"${REPO_ROOT}/test/e2e/data/bmo-deployment/overlays/release-latest"
)
IRONIC_OVERLAYS=(
"${REPO_ROOT}/test/e2e/data/ironic-deployment/overlays/release-25.0"
"${REPO_ROOT}/test/e2e/data/ironic-deployment/overlays/release-26.0"
"${REPO_ROOT}/test/e2e/data/ironic-deployment/overlays/release-27.0"
"${REPO_ROOT}/test/e2e/data/ironic-deployment/overlays/release-latest"
)

Expand Down
2 changes: 0 additions & 2 deletions test/e2e/config/e2e_conf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -291,11 +291,9 @@ variables:
IMAGE_CHECKSUM_TYPE: "sha256"
IMAGE_USERNAME: "metal3"
NODE_DRAIN_TIMEOUT: "0s"
IRONIC_RELEASE_25.0: "data/ironic-deployment/overlays/release-25.0"
IRONIC_RELEASE_26.0: "data/ironic-deployment/overlays/release-26.0"
IRONIC_RELEASE_27.0: "data/ironic-deployment/overlays/release-27.0"
IRONIC_RELEASE_LATEST: "data/ironic-deployment/overlays/release-latest"
BMO_RELEASE_0.6: "data/bmo-deployment/overlays/release-0.6"
BMO_RELEASE_0.8: "data/bmo-deployment/overlays/release-0.8"
BMO_RELEASE_0.9: "data/bmo-deployment/overlays/release-0.9"
BMO_RELEASE_LATEST: "data/bmo-deployment/overlays/release-latest"
Expand Down
4 changes: 0 additions & 4 deletions test/e2e/data/bmo-deployment/overlays/release-0.6/ironic.env

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

50 changes: 29 additions & 21 deletions test/e2e/upgrade_clusterctl_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,26 @@ var (
providerMetal3Prefix = "metal3:v%s"
ironicGoproxy = "https://proxy.golang.org/github.com/metal3-io/ironic-image/@v/list"
bmoGoproxy = "https://proxy.golang.org/github.com/metal3-io/baremetal-operator/@v/list"

k8sVersion string
)

var _ = Describe("When testing cluster upgrade from releases (v1.8=>current) [clusterctl-upgrade]", func() {
var _ = Describe("When testing cluster upgrade from releases (v1.9=>current) [clusterctl-upgrade]", func() {
BeforeEach(func() {
osType := strings.ToLower(os.Getenv("OS"))
Expect(osType).ToNot(Equal(""))
k8sVersion = "v1.32.0"
validateGlobals(specName)
imageURL, imageChecksum := EnsureImage("v1.32.0")
imageURL, imageChecksum := EnsureImage(k8sVersion)
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(), "target_cluster_logs", bootstrapClusterProxy.GetName())
})

minorVersion := "1.8"
minorVersion := "1.9"
bmoFromRelease := "0.9"
ironicFromRelease := "27.0"
bmoToRelease := "latest"
ironicToRelease := "latest"
capiStableRelease, err := capi_e2e.GetStableReleaseOfMinor(ctx, minorVersion)
Expect(err).ToNot(HaveOccurred(), "Failed to get stable version for CAPI minor release : %s", minorVersion)
capm3StableRelease, err := GetCAPM3StableReleaseOfMinor(ctx, minorVersion)
Expand All @@ -57,42 +62,45 @@ var _ = Describe("When testing cluster upgrade from releases (v1.8=>current) [cl
InitWithBootstrapProviders: []string{fmt.Sprintf(providerKubeadmPrefix, capiStableRelease)},
InitWithControlPlaneProviders: []string{fmt.Sprintf(providerKubeadmPrefix, capiStableRelease)},
InitWithInfrastructureProviders: []string{fmt.Sprintf(providerMetal3Prefix, capm3StableRelease)},
InitWithKubernetesVersion: "v1.32.0",
WorkloadKubernetesVersion: "v1.32.0",
InitWithKubernetesVersion: k8sVersion,
WorkloadKubernetesVersion: k8sVersion,
InitWithBinary: fmt.Sprintf(clusterctlDownloadURL, capiStableRelease),
PreInit: func(clusterProxy framework.ClusterProxy) {
preInitFunc(clusterProxy, "0.8", "26.0")
preInitFunc(clusterProxy, bmoFromRelease, ironicFromRelease)
// Override capi/capm3 versions exported in preInit
os.Setenv("CAPI_VERSION", "v1beta1")
os.Setenv("CAPM3_VERSION", "v1beta1")
os.Setenv("KUBECONFIG_BOOTSTRAP", bootstrapClusterProxy.GetKubeconfigPath())
},
PostNamespaceCreated: postNamespaceCreated,
PreUpgrade: func(clusterProxy framework.ClusterProxy) {
preUpgrade(clusterProxy, "latest", "latest")
preUpgrade(clusterProxy, bmoToRelease, ironicToRelease)
},
PreCleanupManagementCluster: func(clusterProxy framework.ClusterProxy) {
preCleanupManagementCluster(clusterProxy, "latest")
preCleanupManagementCluster(clusterProxy, ironicToRelease)
},
MgmtFlavor: osType,
WorkloadFlavor: osType,
}
})
})

var _ = Describe("When testing cluster upgrade from releases (v1.7=>current) [clusterctl-upgrade]", func() {
var _ = Describe("When testing cluster upgrade from releases (v1.8=>current) [clusterctl-upgrade]", func() {
BeforeEach(func() {
osType := strings.ToLower(os.Getenv("OS"))
Expect(osType).ToNot(Equal(""))
k8sVersion = "v1.31.2"
validateGlobals(specName)
imageURL, imageChecksum := EnsureImage("v1.30.0")
imageURL, imageChecksum := EnsureImage(k8sVersion)
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(), "target_cluster_logs", bootstrapClusterProxy.GetName())
})

minorVersion := "1.7"
minorVersion := "1.8"
bmoFromRelease := "0.8"
ironicFromRelease := "26.0"
bmoToRelease := "latest"
ironicToRelease := "latest"
capiStableRelease, err := capi_e2e.GetStableReleaseOfMinor(ctx, minorVersion)
Expect(err).ToNot(HaveOccurred(), "Failed to get stable version for CAPI minor release : %s", minorVersion)
capm3StableRelease, err := GetCAPM3StableReleaseOfMinor(ctx, minorVersion)
Expand All @@ -109,22 +117,22 @@ var _ = Describe("When testing cluster upgrade from releases (v1.7=>current) [cl
InitWithBootstrapProviders: []string{fmt.Sprintf(providerKubeadmPrefix, capiStableRelease)},
InitWithControlPlaneProviders: []string{fmt.Sprintf(providerKubeadmPrefix, capiStableRelease)},
InitWithInfrastructureProviders: []string{fmt.Sprintf(providerMetal3Prefix, capm3StableRelease)},
InitWithKubernetesVersion: "v1.30.0",
WorkloadKubernetesVersion: "v1.30.0",
InitWithKubernetesVersion: k8sVersion,
WorkloadKubernetesVersion: k8sVersion,
InitWithBinary: fmt.Sprintf(clusterctlDownloadURL, capiStableRelease),
PreInit: func(clusterProxy framework.ClusterProxy) {
preInitFunc(clusterProxy, "0.6", "25.0")
preInitFunc(clusterProxy, bmoFromRelease, ironicFromRelease)
// Override capi/capm3 versions exported in preInit
os.Setenv("CAPI_VERSION", "v1beta1")
os.Setenv("CAPM3_VERSION", "v1beta1")
os.Setenv("KUBECONFIG_BOOTSTRAP", bootstrapClusterProxy.GetKubeconfigPath())
},
PostNamespaceCreated: postNamespaceCreated,
PreUpgrade: func(clusterProxy framework.ClusterProxy) {
preUpgrade(clusterProxy, "latest", "latest")
preUpgrade(clusterProxy, bmoToRelease, ironicToRelease)
},
PreCleanupManagementCluster: func(clusterProxy framework.ClusterProxy) {
preCleanupManagementCluster(clusterProxy, "latest")
preCleanupManagementCluster(clusterProxy, ironicToRelease)
},
MgmtFlavor: osType,
WorkloadFlavor: osType,
Expand Down Expand Up @@ -288,7 +296,7 @@ func preInitFunc(clusterProxy framework.ClusterProxy, bmoRelease string, ironicR

// preUpgrade hook should be called from ClusterctlUpgradeSpec before upgrading the management cluster
// it upgrades Ironic and BMO before upgrading the providers.
func preUpgrade(clusterProxy framework.ClusterProxy, ironicUpgradeToRelease string, bmoUpgradeToRelease string) {
func preUpgrade(clusterProxy framework.ClusterProxy, bmoUpgradeToRelease string, ironicUpgradeToRelease string) {
ironicTag, err := GetLatestPatchRelease(ironicGoproxy, ironicUpgradeToRelease)
Expect(err).ToNot(HaveOccurred(), "Failed to fetch ironic version for release %s", ironicUpgradeToRelease)
Logf("Ironic Tag %s\n", ironicTag)
Expand Down
Loading