diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 0f13b2a15..97fea70c0 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -395,6 +395,11 @@ jobs: export APP_VERSION="appver-${SHORT_SHA}-pre-minio-removal" replicated release promote 807 2cHXb1RCttzpR0xvnNWyaZCgDBP --version "${APP_VERSION}" + # re-promote a release containing an old version of embedded-cluster to test upgrades + export APP_VERSION="appver-${SHORT_SHA}-1.8.0-k8s-1.28" + replicated release promote 11615 2cHXb1RCttzpR0xvnNWyaZCgDBP --version "${APP_VERSION}" + replicated release promote 11615 2eAqMYG1IEtX8cwpaO1kgNV6EB3 --version "${APP_VERSION}" + # install the previous k0s version to ensure an upgrade occurs export EC_VERSION="$(git describe --tags --match='[0-9]*.[0-9]*.[0-9]*')-previous-k0s" export APP_VERSION="appver-${SHORT_SHA}-previous-k0s" diff --git a/e2e/install_test.go b/e2e/install_test.go index 29b1faffa..fc3b0618a 100644 --- a/e2e/install_test.go +++ b/e2e/install_test.go @@ -551,19 +551,21 @@ func TestUpgradeEC18FromReplicatedApp(t *testing.T) { }) defer tc.Cleanup(withEnv) - t.Logf("%s: downloading embedded-cluster 1.8.0+k8s-1.28 on node 0", time.Now().Format(time.RFC3339)) - line := []string{"vandoor-prepare.sh", "1.8.0+k8s-1.28", os.Getenv("LICENSE_ID"), "false"} + appVer := fmt.Sprintf("appver-%s-1.8.0-k8s-1.28", os.Getenv("SHORT_SHA")) + + t.Logf("%s: downloading embedded-cluster %s on node 0", appVer, time.Now().Format(time.RFC3339)) + line := []string{"vandoor-prepare.sh", appVer, os.Getenv("LICENSE_ID"), "false"} if stdout, stderr, err := tc.RunCommandOnNode(0, line); err != nil { t.Fatalf("fail to download embedded-cluster on node 0: %v: %s: %s", err, stdout, stderr) } - t.Logf("%s: downloading embedded-cluster 1.8.0+k8s-1.28 on worker node", time.Now().Format(time.RFC3339)) - line = []string{"vandoor-prepare.sh", "1.8.0+k8s-1.28", os.Getenv("LICENSE_ID"), "false"} + t.Logf("%s: downloading embedded-cluster %s on worker node", appVer, time.Now().Format(time.RFC3339)) + line = []string{"vandoor-prepare.sh", appVer, os.Getenv("LICENSE_ID"), "false"} if stdout, stderr, err := tc.RunCommandOnNode(1, line); err != nil { t.Fatalf("fail to download embedded-cluster on node 0: %v: %s: %s", err, stdout, stderr) } - t.Logf("%s: installing embedded-cluster 1.8.0+k8s-1.28 on node 0", time.Now().Format(time.RFC3339)) + t.Logf("%s: installing embedded-cluster %s on node 0", appVer, time.Now().Format(time.RFC3339)) line = []string{"single-node-install.sh", "ui"} if stdout, stderr, err := tc.RunCommandOnNode(0, line, withEnv); err != nil { t.Fatalf("fail to install embedded-cluster on node 0: %v: %s: %s", err, stdout, stderr) @@ -600,7 +602,7 @@ func TestUpgradeEC18FromReplicatedApp(t *testing.T) { } t.Logf("%s: checking installation state", time.Now().Format(time.RFC3339)) - line = []string{"check-installation-state.sh", "1.8.0+k8s-1.28", "v1.28.11"} + line = []string{"check-installation-state.sh", appVer, "v1.28.11"} if stdout, stderr, err := tc.RunCommandOnNode(0, line, withEnv); err != nil { t.Fatalf("fail to check installation state: %v: %s: %s", err, stdout, stderr) } @@ -1039,12 +1041,14 @@ func TestAirgapUpgradeFromEC18(t *testing.T) { withEnv := map[string]string{"KUBECONFIG": "/var/lib/k0s/pki/admin.conf"} + appVer := fmt.Sprintf("appver-%s-1.8.0-k8s-1.28", os.Getenv("SHORT_SHA")) + t.Logf("%s: downloading airgap files", time.Now().Format(time.RFC3339)) airgapInstallBundlePath := "/tmp/airgap-install-bundle.tar.gz" airgapUpgradeBundlePath := "/tmp/airgap-upgrade-bundle.tar.gz" runInParallel(t, func(t *testing.T) error { - return downloadAirgapBundle(t, "1.8.0+k8s-1.28", airgapInstallBundlePath, os.Getenv("AIRGAP_LICENSE_ID")) + return downloadAirgapBundle(t, appVer, airgapInstallBundlePath, os.Getenv("AIRGAP_LICENSE_ID")) }, func(t *testing.T) error { return downloadAirgapBundle(t, fmt.Sprintf("appver-%s-upgrade", os.Getenv("SHORT_SHA")), airgapUpgradeBundlePath, os.Getenv("AIRGAP_LICENSE_ID")) }, @@ -1150,7 +1154,7 @@ func TestAirgapUpgradeFromEC18(t *testing.T) { "check-airgap-installation-state.sh", // the initially installed version is 1.8.0+k8s-1.28 // the '+' character is problematic in the regex used to validate the version, so we use '.' instead - "1.8.0.k8s-1.28", + appVer, "v1.28.11"} if _, _, err := tc.RunCommandOnNode(0, line, withEnv); err != nil { t.Fatalf("fail to check installation state: %v", err) diff --git a/e2e/scripts/check-airgap-installation-state.sh b/e2e/scripts/check-airgap-installation-state.sh index 8c46c5a01..86eb98855 100755 --- a/e2e/scripts/check-airgap-installation-state.sh +++ b/e2e/scripts/check-airgap-installation-state.sh @@ -43,8 +43,8 @@ main() { exit 1 fi - # if this is the current version - if echo "$version" | grep -E "^(dev|appver)-" ; then + # if this is the current version in CI + if echo "$version" | grep -qvE "(pre-minio-removal|1.8.0-k8s)" ; then validate_data_dirs fi diff --git a/e2e/scripts/check-airgap-post-ha-state.sh b/e2e/scripts/check-airgap-post-ha-state.sh index 7434006e4..0031a4df8 100755 --- a/e2e/scripts/check-airgap-post-ha-state.sh +++ b/e2e/scripts/check-airgap-post-ha-state.sh @@ -68,8 +68,8 @@ main() { exit 1 fi - # if this is the current version - if echo "$version" | grep -E "^(dev|appver)-" ; then + # if this is the current version in CI + if echo "$version" | grep -qvE "(pre-minio-removal|1.8.0-k8s)" ; then validate_data_dirs fi diff --git a/e2e/scripts/check-installation-state.sh b/e2e/scripts/check-installation-state.sh index f5bef9185..cb05a5da6 100755 --- a/e2e/scripts/check-installation-state.sh +++ b/e2e/scripts/check-installation-state.sh @@ -48,8 +48,8 @@ main() { exit 1 fi - # if this is the current version - if echo "$version" | grep -E "^(dev|appver)-" ; then + # if this is the current version in CI + if echo "$version" | grep -qvE "(pre-minio-removal|1.8.0-k8s)" ; then validate_data_dirs fi diff --git a/e2e/scripts/check-post-ha-state.sh b/e2e/scripts/check-post-ha-state.sh index 314cede3b..29c8b81c2 100755 --- a/e2e/scripts/check-post-ha-state.sh +++ b/e2e/scripts/check-post-ha-state.sh @@ -61,8 +61,8 @@ main() { exit 1 fi - # if this is the current version - if echo "$version" | grep -E "^(dev|appver)-" ; then + # if this is the current version in CI + if echo "$version" | grep -qvE "(pre-minio-removal|1.8.0-k8s)" ; then validate_data_dirs fi