From 54b2a0be53909c96f0f0e53bbd3e178db0f28dde Mon Sep 17 00:00:00 2001 From: Peppi-Lotta Date: Tue, 30 Apr 2024 15:47:22 +0300 Subject: [PATCH] Release-1.7 related changes Signed-off-by: Peppi-Lotta --- CONTRIBUTING.md | 6 +-- Makefile | 4 +- README.md | 36 ++++++++-------- docs/e2e-test.md | 1 + hack/verify-release.sh | 2 +- test/e2e/config/e2e_conf.yaml | 39 +++++++++++++++++ test/e2e/upgrade_clusterctl_test.go | 67 +++++++++++++++++++++++++++++ 7 files changed, 131 insertions(+), 24 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 0bccfd7631..6621406dea 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -138,9 +138,9 @@ is defined above. API version reaches EOL. - We will maintain test coverage for all supported minor releases and for one additional release for the current stable API version in case we have to do an - emergency patch release. For example, if v1.5 and v1.4 are currently - supported, we will also maintain test coverage for v1.3 for one additional - release cycle. When v1.6 is released, tests for v1.3 will be removed. + emergency patch release. For example, if v1.7 and v1.6 are currently + supported, we will also maintain test coverage for v1.5 for one additional + release cycle. When v1.7 is released, tests for v1.4 will be removed. diff --git a/Makefile b/Makefile index 9e60e417f0..2943796dfa 100644 --- a/Makefile +++ b/Makefile @@ -546,12 +546,12 @@ delete-examples-clusterclass: ## -------------------------------------- ##@ release: -## latest git tag for the commit, e.g., v1.4.0 +## latest git tag for the commit, e.g., v1.7.0 RELEASE_TAG ?= $(shell git describe --abbrev=0 2>/dev/null) ifneq (,$(findstring -,$(RELEASE_TAG))) PRE_RELEASE=true endif -# the previous release tag, e.g., v1.4.0, excluding pre-release tags +# the previous release tag, e.g., v1.7.0, excluding pre-release tags PREVIOUS_TAG ?= $(shell git tag -l | grep -E "^v[0-9]+\.[0-9]+\.[0-9]+" | sort -V | grep -B1 $(RELEASE_TAG) | grep -E "^v[0-9]+\.[0-9]+\.[0-9]+$$" | head -n 1 2>/dev/null) RELEASE_DIR := out RELEASE_NOTES_DIR := releasenotes diff --git a/README.md b/README.md index afb84ebc01..24de932f25 100644 --- a/README.md +++ b/README.md @@ -63,7 +63,7 @@ need to be manually installed. Example flow of installing Metal3 provider: provider name as follows: ```shell - clusterctl init --infrastructure metal3:v1.6.0 + clusterctl init --infrastructure metal3:v1.7.0 ``` 1. Deploy Baremetal Operator manifests and CRDs. You need to install @@ -141,6 +141,13 @@ To trigger e2e test on a PR, use the following phrases: - **/test-centos-e2e-integration-test-main** runs integration e2e tests with CAPM3 API version v1beta1 and branch main on CentOS +Release-1.7 branch: + +- **/test metal3-ubuntu-e2e-integration-test-release-1-7** runs integration e2e + tests with CAPM3 API version v1beta1 and branch release-1.7 on Ubuntu +- **/test metal3-centos-e2e-integration-test-release-1-7** runs integration e2e + tests with CAPM3 API version v1beta1 and branch release-1.7 on CentOS + Release-1.6 branch: - **/test metal3-ubuntu-e2e-integration-test-release-1-6** runs integration e2e @@ -155,13 +162,6 @@ Release-1.5 branch: - **/test metal3-centos-e2e-integration-test-release-1-5** runs integration e2e tests with CAPM3 API version v1beta1 and branch release-1.5 on CentOS -Release-1.4 branch: - -- **/test metal3-ubuntu-e2e-integration-test-release-1-4** runs integration e2e - tests with CAPM3 API version v1beta1 and branch release-1.4 on Ubuntu -- **/test metal3-centos-e2e-integration-test-release-1-4** runs integration e2e - tests with CAPM3 API version v1beta1 and branch release-1.4 on CentOS - ## Basic tests Unlike integration tests, basic tests focus on the target cluster creation @@ -181,6 +181,13 @@ On main branch: - **/test metal3-centos-e2e-feature-test-main** runs e2e feature tests with CAPM3 API version v1beta1 and branch main on CentOS +Release-1.7 branch: + +- **/test metal3-ubuntu-e2e-feature-test-release-1-7** runs e2e feature tests with + CAPM3 API version v1beta1 and branch release-1.7 on Ubuntu +- **/test metal3-centos-e2e-feature-test-release-1-7** runs e2e feature tests with + CAPM3 API version v1beta1 and branch release-1.7 on CentOS + Release-1.6 branch: - **/test metal3-ubuntu-e2e-feature-test-release-1-6** runs e2e feature tests with @@ -195,13 +202,6 @@ Release-1.5 branch: - **/test metal3-centos-e2e-feature-test-1-5** runs e2e feature tests with CAPM3 API version v1beta1 and branch release-1.5 on CentOS -Release-1.4 branch: - -- **/test metal3-ubuntu-e2e-feature-test-release-1-4** runs e2e feature tests - with CAPM3 API version v1beta1 and branch release-1.4 on Ubuntu -- **/test metal3-centos-e2e-feature-test-release-1-4** runs e2e feature tests - with CAPM3 API version v1beta1 and branch release-1.4 on CentOS - ### Upgrade tests #### Clusterctl upgrade tests @@ -212,15 +212,15 @@ We run upgrade test on main branch from different releases: - **/test metal3-e2e-clusterctl-upgrade-test-main** runs e2e clusterctl upgrade tests on main with Ubuntu -- **/test metal3-e2e-clusterctl-upgrade-test-release-1-4** runs e2e clusterctl - upgrade tests on release-1.4 with Ubuntu - - **/test metal3-e2e-clusterctl-upgrade-test-release-1-5** runs e2e clusterctl upgrade tests on release-1.5 with Ubuntu - **/test metal3-e2e-clusterctl-upgrade-test-release-1-6** runs e2e clusterctl upgrade tests on release-1.6 with Ubuntu +- **/test metal3-e2e-clusterctl-upgrade-test-release-1-7** runs e2e clusterctl + upgrade tests on release-1.7 with Ubuntu + #### K8s upgrade tests CAPM3 tests upgrading kubernetes between last 3 releases. diff --git a/docs/e2e-test.md b/docs/e2e-test.md index b009e8a80e..31d6d8b1d5 100644 --- a/docs/e2e-test.md +++ b/docs/e2e-test.md @@ -101,6 +101,7 @@ in the ephemeral cluster either before pivoting or after re-pivoting. | tests | CAPM3 from | CAPM3 to | CAPI from | CAPI to | | --------------| ----------- | --------- | ---------- |---------------- | +| v1.7=>current | v1.7.0 | main | v1.7.1 | latest release | | v1.6=>current | v1.6.1 | main | v1.6.3 | latest release | | v1.5=>current | v1.5.3 | main | v1.5.7 | latest release | diff --git a/hack/verify-release.sh b/hack/verify-release.sh index 5b6ceafdf8..f14e611ab9 100755 --- a/hack/verify-release.sh +++ b/hack/verify-release.sh @@ -529,7 +529,7 @@ _module_get_latest_patch_release() { # get latest patch release from given version # module needs to contain full module url - # version is minor release prefix, like v1.4. + # version is minor release prefix, like v1.7. local repo="$1" local version="$2" diff --git a/test/e2e/config/e2e_conf.yaml b/test/e2e/config/e2e_conf.yaml index 22d3c39d7c..e8fd37b768 100644 --- a/test/e2e/config/e2e_conf.yaml +++ b/test/e2e/config/e2e_conf.yaml @@ -17,6 +17,15 @@ providers: - name: cluster-api type: CoreProvider versions: + - name: "{go://sigs.k8s.io/cluster-api@v1.7}" + value: "https://github.com/kubernetes-sigs/cluster-api/releases/download/{go://sigs.k8s.io/cluster-api@v1.7}/core-components.yaml" + type: "url" + contract: v1beta1 + replacements: + - old: --metrics-addr=127.0.0.1:8080 + new: --metrics-addr=:8080 + files: + - sourcePath: "../data/shared/v1.7/metadata.yaml" - name: "{go://sigs.k8s.io/cluster-api@v1.6}" value: "https://github.com/kubernetes-sigs/cluster-api/releases/download/{go://sigs.k8s.io/cluster-api@v1.6}/core-components.yaml" type: "url" @@ -38,6 +47,15 @@ providers: - name: kubeadm type: BootstrapProvider versions: + - name: "{go://sigs.k8s.io/cluster-api@v1.7}" + value: "https://github.com/kubernetes-sigs/cluster-api/releases/download/{go://sigs.k8s.io/cluster-api@v1.7}/bootstrap-components.yaml" + type: "url" + contract: v1beta1 + replacements: + - old: --metrics-addr=127.0.0.1:8080 + new: --metrics-addr=:8080 + files: + - sourcePath: "../data/shared/v1.7/metadata.yaml" - name: "{go://sigs.k8s.io/cluster-api@v1.6}" value: "https://github.com/kubernetes-sigs/cluster-api/releases/download/{go://sigs.k8s.io/cluster-api@v1.6}/bootstrap-components.yaml" type: "url" @@ -59,6 +77,16 @@ providers: - name: kubeadm type: ControlPlaneProvider versions: + - name: "{go://sigs.k8s.io/cluster-api@v1.7}" + value: "https://github.com/kubernetes-sigs/cluster-api/releases/download/{go://sigs.k8s.io/cluster-api@v1.7}/control-plane-components.yaml" + type: "url" + contract: v1beta1 + replacements: + - old: --metrics-addr=127.0.0.1:8080 + new: --metrics-addr=:8080 + files: + - sourcePath: "../data/shared/v1.7/metadata.yaml" + versions: - name: "{go://sigs.k8s.io/cluster-api@v1.6}" value: "https://github.com/kubernetes-sigs/cluster-api/releases/download/{go://sigs.k8s.io/cluster-api@v1.6}/control-plane-components.yaml" type: "url" @@ -84,6 +112,17 @@ providers: - name: metal3 type: InfrastructureProvider versions: + - name: "{go://github.com/metal3-io/cluster-api-provider-metal3@v1.7}" + value: "https://github.com/metal3-io/cluster-api-provider-metal3/releases/download/{go://github.com/metal3-io/cluster-api-provider-metal3@v1.7}/infrastructure-components.yaml" + type: "url" + contract: v1beta1 + files: + - sourcePath: "../data/infrastructure-metal3/v1.7/metadata.yaml" + targetName: "metadata.yaml" + - sourcePath: "../_out/cluster-template-ubuntu.yaml" + targetName: "cluster-template-ubuntu.yaml" + - sourcePath: "../_out/cluster-template-upgrade-workload.yaml" + targetName: "cluster-template-upgrade-workload.yaml" - name: "{go://github.com/metal3-io/cluster-api-provider-metal3@v1.6}" value: "https://github.com/metal3-io/cluster-api-provider-metal3/releases/download/{go://github.com/metal3-io/cluster-api-provider-metal3@v1.6}/infrastructure-components.yaml" type: "url" diff --git a/test/e2e/upgrade_clusterctl_test.go b/test/e2e/upgrade_clusterctl_test.go index b267427e37..7e25a3deb2 100644 --- a/test/e2e/upgrade_clusterctl_test.go +++ b/test/e2e/upgrade_clusterctl_test.go @@ -27,6 +27,73 @@ var ( providerMetal3Prefix = "metal3:v%s" ) +var _ = Describe("When testing cluster upgrade from releases (v1.7=>current) [clusterctl-upgrade]", func() { + BeforeEach(func() { + osType := strings.ToLower(os.Getenv("OS")) + Expect(osType).ToNot(Equal("")) + validateGlobals(specName) + imageURL, imageChecksum := EnsureImage("v1.30.0") + 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()) + }) + + minorVersion := "1.7" + 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) + Expect(err).ToNot(HaveOccurred(), "Failed to get stable version for CAPM3 minor release : %s", minorVersion) + + 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(providerCAPIPrefix, capiStableRelease), + 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", + InitWithBinary: fmt.Sprintf(clusterctlDownloadURL, capiStableRelease), + PreInit: func(clusterProxy framework.ClusterProxy) { + preInitFunc(clusterProxy) + // 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: preUpgrade, + PreCleanupManagementCluster: preCleanupManagementCluster, + MgmtFlavor: osType, + WorkloadFlavor: osType, + } + }) + AfterEach(func() { + // Recreate bmh that was used in capi namespace in metal3 + //#nosec G204 -- We need to pass in the file name here. + cmd := exec.Command("bash", "-c", "kubectl apply -f bmhosts_crs.yaml -n metal3") + cmd.Dir = workDir + output, err := cmd.CombinedOutput() + Logf("Applying bmh to metal3 namespace : \n %v", string(output)) + Expect(err).ToNot(HaveOccurred()) + // wait for all bmh to become available + bootstrapClient := bootstrapClusterProxy.GetClient() + ListBareMetalHosts(ctx, bootstrapClient, client.InNamespace(namespace)) + WaitForNumBmhInState(ctx, bmov1alpha1.StateAvailable, WaitForNumInput{ + Client: bootstrapClient, + Options: []client.ListOption{client.InNamespace(namespace)}, + Replicas: 5, + Intervals: e2eConfig.GetIntervals(specName, "wait-bmh-available"), + }) + ListBareMetalHosts(ctx, bootstrapClient, client.InNamespace(namespace)) + }) +}) + var _ = Describe("When testing cluster upgrade from releases (v1.6=>current) [clusterctl-upgrade]", func() { BeforeEach(func() { osType := strings.ToLower(os.Getenv("OS"))