From f6c1f6ebfc858fe052cde92cfd81e3832bc3882c Mon Sep 17 00:00:00 2001 From: Ethan Mosbaugh Date: Tue, 17 Dec 2024 13:49:18 -0800 Subject: [PATCH 01/14] feat(ci): e2e tests should use new dr --- e2e/kots-release-install-newdr/backup.yaml | 6 +++++- e2e/kots-release-install-newdr/deployment-2.yaml | 1 - e2e/kots-release-install-newdr/deployment.yaml | 1 - e2e/kots-release-install-newdr/kots-app.yaml | 4 +--- e2e/kots-release-install-newdr/restore.yaml | 5 ++++- e2e/restore_test.go | 13 ++++--------- 6 files changed, 14 insertions(+), 16 deletions(-) diff --git a/e2e/kots-release-install-newdr/backup.yaml b/e2e/kots-release-install-newdr/backup.yaml index 5a5921606..0ba4108a6 100644 --- a/e2e/kots-release-install-newdr/backup.yaml +++ b/e2e/kots-release-install-newdr/backup.yaml @@ -7,7 +7,11 @@ metadata: spec: ttl: 36h0m0s includedNamespaces: - - my-app + - kotsadm + orLabelSelectors: + - matchExpressions: + - { key: kots.io/backup, operator: DoesNotExist } + - { key: replicated.com/disaster-recovery, operator: DoesNotExist } hooks: resources: - name: test-hook diff --git a/e2e/kots-release-install-newdr/deployment-2.yaml b/e2e/kots-release-install-newdr/deployment-2.yaml index 5fed3ddc6..2d46ae54c 100644 --- a/e2e/kots-release-install-newdr/deployment-2.yaml +++ b/e2e/kots-release-install-newdr/deployment-2.yaml @@ -2,7 +2,6 @@ apiVersion: apps/v1 kind: Deployment metadata: name: second - namespace: my-app labels: app: second replicated.com/disaster-recovery: app diff --git a/e2e/kots-release-install-newdr/deployment.yaml b/e2e/kots-release-install-newdr/deployment.yaml index 96ff5e132..27fd581fd 100644 --- a/e2e/kots-release-install-newdr/deployment.yaml +++ b/e2e/kots-release-install-newdr/deployment.yaml @@ -2,7 +2,6 @@ apiVersion: apps/v1 kind: Deployment metadata: name: nginx - namespace: my-app labels: app: example component: nginx diff --git a/e2e/kots-release-install-newdr/kots-app.yaml b/e2e/kots-release-install-newdr/kots-app.yaml index ade93ddbf..2cb389bb8 100644 --- a/e2e/kots-release-install-newdr/kots-app.yaml +++ b/e2e/kots-release-install-newdr/kots-app.yaml @@ -7,10 +7,8 @@ spec: title: Embedded Cluster Smoke Test Staging App icon: https://raw.githubusercontent.com/cncf/artwork/master/projects/kubernetes/icon/color/kubernetes-icon-color.png allowRollback: true - additionalNamespaces: - - my-app statusInformers: - - my-app/deployment/nginx + - deployment/nginx ports: - serviceName: "nginx" servicePort: 80 diff --git a/e2e/kots-release-install-newdr/restore.yaml b/e2e/kots-release-install-newdr/restore.yaml index 799ecb74b..ec09f95fa 100644 --- a/e2e/kots-release-install-newdr/restore.yaml +++ b/e2e/kots-release-install-newdr/restore.yaml @@ -12,7 +12,10 @@ spec: resources: - name: restore-hook-1 includedNamespaces: - - my-app + - kotsadm + labelSelector: + matchLabels: + app: example postHooks: - init: initContainers: diff --git a/e2e/restore_test.go b/e2e/restore_test.go index fd043112f..9db658bfb 100644 --- a/e2e/restore_test.go +++ b/e2e/restore_test.go @@ -129,14 +129,9 @@ func TestSingleNodeNewDisasterRecovery(t *testing.T) { }) defer tc.Cleanup() - // Use an alternate data directory - withEnv := map[string]string{ - "APP_NAMESPACE": "my-app", - } - t.Logf("%s: installing embedded-cluster on node 0", time.Now().Format(time.RFC3339)) line := []string{"single-node-install.sh", "ui"} - if stdout, stderr, err := tc.RunCommandOnNode(0, line, withEnv); err != nil { + if stdout, stderr, err := tc.RunCommandOnNode(0, line); err != nil { t.Fatalf("fail to install embedded-cluster on node 0: %v: %s: %s", err, stdout, stderr) } @@ -151,7 +146,7 @@ func TestSingleNodeNewDisasterRecovery(t *testing.T) { t.Logf("%s: checking installation state", time.Now().Format(time.RFC3339)) line = []string{"check-installation-state.sh", appVersion, k8sVersion()} - if stdout, stderr, err := tc.RunCommandOnNode(0, line, withEnv); err != nil { + if stdout, stderr, err := tc.RunCommandOnNode(0, line); err != nil { t.Fatalf("fail to check installation state: %v: %s: %s", err, stdout, stderr) } @@ -182,13 +177,13 @@ func TestSingleNodeNewDisasterRecovery(t *testing.T) { t.Logf("%s: checking installation state", time.Now().Format(time.RFC3339)) line = []string{"check-installation-state.sh", appVersion, k8sVersion()} - if stdout, stderr, err := tc.RunCommandOnNode(0, line, withEnv); err != nil { + if stdout, stderr, err := tc.RunCommandOnNode(0, line); err != nil { t.Fatalf("fail to check installation state: %v: %s: %s", err, stdout, stderr) } t.Logf("%s: checking post-restore state", time.Now().Format(time.RFC3339)) line = []string{"check-post-restore-newdr.sh"} - if stdout, stderr, err := tc.RunCommandOnNode(0, line, withEnv); err != nil { + if stdout, stderr, err := tc.RunCommandOnNode(0, line); err != nil { t.Fatalf("fail to check post-restore state: %v: %s: %s", err, stdout, stderr) } From 179a22098e0bce9a710116a16e35b983681c33bb Mon Sep 17 00:00:00 2001 From: Ethan Mosbaugh Date: Tue, 17 Dec 2024 13:53:20 -0800 Subject: [PATCH 02/14] f --- .../backup.yaml | 0 .../restore.yaml | 0 e2e/kots-release-upgrade/backup.yaml | 34 +++++++++++++++++++ e2e/kots-release-upgrade/restore.yaml | 27 +++++++++++++++ e2e/restore_test.go | 16 ++++----- 5 files changed, 68 insertions(+), 9 deletions(-) rename e2e/{kots-release-install-newdr => kots-release-install}/backup.yaml (100%) rename e2e/{kots-release-install-newdr => kots-release-install}/restore.yaml (100%) create mode 100644 e2e/kots-release-upgrade/backup.yaml create mode 100644 e2e/kots-release-upgrade/restore.yaml diff --git a/e2e/kots-release-install-newdr/backup.yaml b/e2e/kots-release-install/backup.yaml similarity index 100% rename from e2e/kots-release-install-newdr/backup.yaml rename to e2e/kots-release-install/backup.yaml diff --git a/e2e/kots-release-install-newdr/restore.yaml b/e2e/kots-release-install/restore.yaml similarity index 100% rename from e2e/kots-release-install-newdr/restore.yaml rename to e2e/kots-release-install/restore.yaml diff --git a/e2e/kots-release-upgrade/backup.yaml b/e2e/kots-release-upgrade/backup.yaml new file mode 100644 index 000000000..0ba4108a6 --- /dev/null +++ b/e2e/kots-release-upgrade/backup.yaml @@ -0,0 +1,34 @@ +apiVersion: velero.io/v1 +kind: Backup +metadata: + name: backup + annotations: + preserve: me +spec: + ttl: 36h0m0s + includedNamespaces: + - kotsadm + orLabelSelectors: + - matchExpressions: + - { key: kots.io/backup, operator: DoesNotExist } + - { key: replicated.com/disaster-recovery, operator: DoesNotExist } + hooks: + resources: + - name: test-hook + includedResources: + - 'pods' + labelSelector: + matchLabels: + app: example + component: nginx + pre: + - exec: + container: nginx + command: + - /bin/uname + - -a + post: + - exec: + command: + - /bin/uname + - -a diff --git a/e2e/kots-release-upgrade/restore.yaml b/e2e/kots-release-upgrade/restore.yaml new file mode 100644 index 000000000..ec09f95fa --- /dev/null +++ b/e2e/kots-release-upgrade/restore.yaml @@ -0,0 +1,27 @@ +apiVersion: velero.io/v1 +kind: Restore +metadata: + name: restore + annotations: + preserve: me +spec: + backupName: backup + includedNamespaces: + - '*' + hooks: + resources: + - name: restore-hook-1 + includedNamespaces: + - kotsadm + labelSelector: + matchLabels: + app: example + postHooks: + - init: + initContainers: + - name: restore-hook-init1 + image: proxy.replicated.com/anonymous/nginx:1.24-alpine + command: + - /bin/ash + - -c + - echo -n "FOOBARBAZ" > /tmp/foobarbaz diff --git a/e2e/restore_test.go b/e2e/restore_test.go index 9db658bfb..f190a8756 100644 --- a/e2e/restore_test.go +++ b/e2e/restore_test.go @@ -85,6 +85,12 @@ func TestSingleNodeDisasterRecovery(t *testing.T) { t.Fatalf("fail to check installation state: %v: %s: %s", err, stdout, stderr) } + t.Logf("%s: checking post-restore state", time.Now().Format(time.RFC3339)) + line = []string{"check-post-restore-newdr.sh"} + if stdout, stderr, err := tc.RunCommandOnNode(0, line); err != nil { + t.Fatalf("fail to check post-restore state: %v: %s: %s", err, stdout, stderr) + } + appUpgradeVersion := fmt.Sprintf("appver-%s-upgrade", os.Getenv("SHORT_SHA")) testArgs = []string{appUpgradeVersion} @@ -102,7 +108,7 @@ func TestSingleNodeDisasterRecovery(t *testing.T) { t.Logf("%s: test complete", time.Now().Format(time.RFC3339)) } -func TestSingleNodeNewDisasterRecovery(t *testing.T) { +func TestSingleNodeLegacyDisasterRecovery(t *testing.T) { t.Parallel() requiredEnvVars := []string{ @@ -181,14 +187,6 @@ func TestSingleNodeNewDisasterRecovery(t *testing.T) { t.Fatalf("fail to check installation state: %v: %s: %s", err, stdout, stderr) } - t.Logf("%s: checking post-restore state", time.Now().Format(time.RFC3339)) - line = []string{"check-post-restore-newdr.sh"} - if stdout, stderr, err := tc.RunCommandOnNode(0, line); err != nil { - t.Fatalf("fail to check post-restore state: %v: %s: %s", err, stdout, stderr) - } - - // TODO: upgrade - t.Logf("%s: test complete", time.Now().Format(time.RFC3339)) } From 319e1f7e4c191ce79df12b92cb75c3b0631c2def Mon Sep 17 00:00:00 2001 From: Ethan Mosbaugh Date: Tue, 17 Dec 2024 13:55:46 -0800 Subject: [PATCH 03/14] f --- .github/workflows/ci.yaml | 36 +++++++++---------- .../cluster-config.yaml | 0 .../config.yaml | 0 .../deployment-2.yaml | 0 .../deployment.yaml | 0 .../k8s-app.yaml | 0 .../kots-app.yaml | 0 .../kots-lint-config.yaml | 0 .../preflight.yaml | 0 .../troubleshoot.yaml | 0 e2e/restore_test.go | 6 ++-- ...restore-newdr.sh => check-post-restore.sh} | 0 12 files changed, 21 insertions(+), 21 deletions(-) rename e2e/{kots-release-install-newdr => kots-release-install-legacydr}/cluster-config.yaml (100%) rename e2e/{kots-release-install-newdr => kots-release-install-legacydr}/config.yaml (100%) rename e2e/{kots-release-install-newdr => kots-release-install-legacydr}/deployment-2.yaml (100%) rename e2e/{kots-release-install-newdr => kots-release-install-legacydr}/deployment.yaml (100%) rename e2e/{kots-release-install-newdr => kots-release-install-legacydr}/k8s-app.yaml (100%) rename e2e/{kots-release-install-newdr => kots-release-install-legacydr}/kots-app.yaml (100%) rename e2e/{kots-release-install-newdr => kots-release-install-legacydr}/kots-lint-config.yaml (100%) rename e2e/{kots-release-install-newdr => kots-release-install-legacydr}/preflight.yaml (100%) rename e2e/{kots-release-install-newdr => kots-release-install-legacydr}/troubleshoot.yaml (100%) rename e2e/scripts/{check-post-restore-newdr.sh => check-post-restore.sh} (100%) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index b1422d864..80c7946a8 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -204,8 +204,8 @@ jobs: echo "K0S_VERSION=\"$K0S_VERSION\"" echo "k0s_version=$K0S_VERSION" >> "$GITHUB_OUTPUT" - build-newdr: - name: Build new DR + build-legacydr: + name: Build legacy DR runs-on: embedded-cluster needs: - git-sha @@ -239,7 +239,7 @@ jobs: env: APP_CHANNEL_ID: 2cHXb1RCttzpR0xvnNWyaZCgDBP APP_CHANNEL_SLUG: ci - RELEASE_YAML_DIR: e2e/kots-release-install-newdr + RELEASE_YAML_DIR: e2e/kots-release-install-legacydr S3_BUCKET: "tf-staging-embedded-cluster-bin" USES_DEV_BUCKET: "0" AWS_ACCESS_KEY_ID: ${{ secrets.STAGING_EMBEDDED_CLUSTER_UPLOAD_IAM_KEY_ID }} @@ -251,20 +251,20 @@ jobs: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | export K0S_VERSION=$(make print-K0S_VERSION) - export EC_VERSION=$(git describe --tags --abbrev=4 --match='[0-9]*.[0-9]*.[0-9]*')-newdr - export APP_VERSION=appver-dev-${{ needs.git-sha.outputs.git_sha }}-newdr + export EC_VERSION=$(git describe --tags --abbrev=4 --match='[0-9]*.[0-9]*.[0-9]*')-legacydr + export APP_VERSION=appver-dev-${{ needs.git-sha.outputs.git_sha }}-legacydr # avoid rate limiting export FIO_VERSION=$(gh release list --repo axboe/fio --json tagName,isLatest | jq -r '.[] | select(.isLatest==true)|.tagName' | cut -d- -f2) ./scripts/build-and-release.sh - cp output/bin/embedded-cluster output/bin/embedded-cluster-newdr + cp output/bin/embedded-cluster output/bin/embedded-cluster-legacydr - name: Upload release uses: actions/upload-artifact@v4 with: - name: newdr-release + name: legacydr-release path: | - output/bin/embedded-cluster-newdr + output/bin/embedded-cluster-legacydr - name: Export k0s version id: export @@ -509,7 +509,7 @@ jobs: needs: - git-sha - build-current - - build-newdr + - build-legacydr - build-previous-k0s - build-upgrade - find-previous-stable @@ -564,9 +564,9 @@ jobs: ./scripts/ci-release-app.sh # promote a release with improved dr support - export EC_VERSION="$(git describe --tags --abbrev=4 --match='[0-9]*.[0-9]*.[0-9]*')-newdr" - export APP_VERSION="appver-${SHORT_SHA}-newdr" - export RELEASE_YAML_DIR=e2e/kots-release-install-newdr + export EC_VERSION="$(git describe --tags --abbrev=4 --match='[0-9]*.[0-9]*.[0-9]*')-legacydr" + export APP_VERSION="appver-${SHORT_SHA}-legacydr" + export RELEASE_YAML_DIR=e2e/kots-release-install-legacydr ./scripts/ci-release-app.sh # then a noop upgrade @@ -610,9 +610,9 @@ jobs: ./scripts/ci-release-app.sh # promote a release with improved dr support - export EC_VERSION="$(git describe --tags --abbrev=4 --match='[0-9]*.[0-9]*.[0-9]*')-newdr" - export APP_VERSION="appver-${SHORT_SHA}-newdr" - export RELEASE_YAML_DIR=e2e/kots-release-install-newdr + export EC_VERSION="$(git describe --tags --abbrev=4 --match='[0-9]*.[0-9]*.[0-9]*')-legacydr" + export APP_VERSION="appver-${SHORT_SHA}-legacydr" + export RELEASE_YAML_DIR=e2e/kots-release-install-legacydr ./scripts/ci-release-app.sh # and finally an app upgrade @@ -654,7 +654,7 @@ jobs: needs: - git-sha - build-current - - build-newdr + - build-legacydr - build-previous-k0s - build-upgrade - find-previous-stable @@ -706,7 +706,7 @@ jobs: - name: Download new DR binary uses: actions/download-artifact@v4 with: - name: newdr-release + name: legacydr-release path: output/bin - name: Setup go uses: actions/setup-go@v5 @@ -754,7 +754,7 @@ jobs: runs-on: ${{ matrix.runner || 'ubuntu-22.04' }} needs: - build-current - - build-newdr + - build-legacydr - build-previous-k0s - build-upgrade - find-previous-stable diff --git a/e2e/kots-release-install-newdr/cluster-config.yaml b/e2e/kots-release-install-legacydr/cluster-config.yaml similarity index 100% rename from e2e/kots-release-install-newdr/cluster-config.yaml rename to e2e/kots-release-install-legacydr/cluster-config.yaml diff --git a/e2e/kots-release-install-newdr/config.yaml b/e2e/kots-release-install-legacydr/config.yaml similarity index 100% rename from e2e/kots-release-install-newdr/config.yaml rename to e2e/kots-release-install-legacydr/config.yaml diff --git a/e2e/kots-release-install-newdr/deployment-2.yaml b/e2e/kots-release-install-legacydr/deployment-2.yaml similarity index 100% rename from e2e/kots-release-install-newdr/deployment-2.yaml rename to e2e/kots-release-install-legacydr/deployment-2.yaml diff --git a/e2e/kots-release-install-newdr/deployment.yaml b/e2e/kots-release-install-legacydr/deployment.yaml similarity index 100% rename from e2e/kots-release-install-newdr/deployment.yaml rename to e2e/kots-release-install-legacydr/deployment.yaml diff --git a/e2e/kots-release-install-newdr/k8s-app.yaml b/e2e/kots-release-install-legacydr/k8s-app.yaml similarity index 100% rename from e2e/kots-release-install-newdr/k8s-app.yaml rename to e2e/kots-release-install-legacydr/k8s-app.yaml diff --git a/e2e/kots-release-install-newdr/kots-app.yaml b/e2e/kots-release-install-legacydr/kots-app.yaml similarity index 100% rename from e2e/kots-release-install-newdr/kots-app.yaml rename to e2e/kots-release-install-legacydr/kots-app.yaml diff --git a/e2e/kots-release-install-newdr/kots-lint-config.yaml b/e2e/kots-release-install-legacydr/kots-lint-config.yaml similarity index 100% rename from e2e/kots-release-install-newdr/kots-lint-config.yaml rename to e2e/kots-release-install-legacydr/kots-lint-config.yaml diff --git a/e2e/kots-release-install-newdr/preflight.yaml b/e2e/kots-release-install-legacydr/preflight.yaml similarity index 100% rename from e2e/kots-release-install-newdr/preflight.yaml rename to e2e/kots-release-install-legacydr/preflight.yaml diff --git a/e2e/kots-release-install-newdr/troubleshoot.yaml b/e2e/kots-release-install-legacydr/troubleshoot.yaml similarity index 100% rename from e2e/kots-release-install-newdr/troubleshoot.yaml rename to e2e/kots-release-install-legacydr/troubleshoot.yaml diff --git a/e2e/restore_test.go b/e2e/restore_test.go index f190a8756..fd2c94d56 100644 --- a/e2e/restore_test.go +++ b/e2e/restore_test.go @@ -86,7 +86,7 @@ func TestSingleNodeDisasterRecovery(t *testing.T) { } t.Logf("%s: checking post-restore state", time.Now().Format(time.RFC3339)) - line = []string{"check-post-restore-newdr.sh"} + line = []string{"check-post-restore.sh"} if stdout, stderr, err := tc.RunCommandOnNode(0, line); err != nil { t.Fatalf("fail to check post-restore state: %v: %s: %s", err, stdout, stderr) } @@ -131,7 +131,7 @@ func TestSingleNodeLegacyDisasterRecovery(t *testing.T) { Nodes: 1, Distro: "debian-bookworm", LicensePath: "snapshot-license.yaml", - ECBinaryPath: "../output/bin/embedded-cluster-newdr", + ECBinaryPath: "../output/bin/embedded-cluster-legacydr", }) defer tc.Cleanup() @@ -148,7 +148,7 @@ func TestSingleNodeLegacyDisasterRecovery(t *testing.T) { t.Fatalf("fail to run playwright test deploy-app: %v", err) } - appVersion := fmt.Sprintf("appver-%s-newdr", os.Getenv("SHORT_SHA")) + appVersion := fmt.Sprintf("appver-%s-legacydr", os.Getenv("SHORT_SHA")) t.Logf("%s: checking installation state", time.Now().Format(time.RFC3339)) line = []string{"check-installation-state.sh", appVersion, k8sVersion()} diff --git a/e2e/scripts/check-post-restore-newdr.sh b/e2e/scripts/check-post-restore.sh similarity index 100% rename from e2e/scripts/check-post-restore-newdr.sh rename to e2e/scripts/check-post-restore.sh From 3ee656d5224a807e8874f291d5f2621a118213fd Mon Sep 17 00:00:00 2001 From: Ethan Mosbaugh Date: Tue, 17 Dec 2024 13:58:35 -0800 Subject: [PATCH 04/14] f --- e2e/restore_test.go | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/e2e/restore_test.go b/e2e/restore_test.go index fd2c94d56..86007ee4e 100644 --- a/e2e/restore_test.go +++ b/e2e/restore_test.go @@ -270,6 +270,12 @@ func TestSingleNodeDisasterRecoveryWithProxy(t *testing.T) { t.Fatalf("fail to check installation state: %v", err) } + t.Logf("%s: checking post-restore state", time.Now().Format(time.RFC3339)) + line = []string{"check-post-restore.sh"} + if stdout, stderr, err := tc.RunCommandOnNode(0, line); err != nil { + t.Fatalf("fail to check post-restore state: %v: %s: %s", err, stdout, stderr) + } + t.Logf("%s: test complete", time.Now().Format(time.RFC3339)) } @@ -446,6 +452,12 @@ func TestSingleNodeAirgapDisasterRecovery(t *testing.T) { t.Fatalf("fail to check installation state: %v", err) } + t.Logf("%s: checking post-restore state", time.Now().Format(time.RFC3339)) + line = []string{"check-post-restore.sh"} + if stdout, stderr, err := tc.RunCommandOnNode(0, line); err != nil { + t.Fatalf("fail to check post-restore state: %v: %s: %s", err, stdout, stderr) + } + t.Logf("%s: running airgap update", time.Now().Format(time.RFC3339)) line = []string{"airgap-update.sh"} if _, _, err := tc.RunCommandOnNode(0, line); err != nil { @@ -649,6 +661,12 @@ func TestMultiNodeHADisasterRecovery(t *testing.T) { t.Fatalf("fail to check post ha state: %v: %s: %s", err, stdout, stderr) } + t.Logf("%s: checking post-restore state", time.Now().Format(time.RFC3339)) + line = []string{"check-post-restore.sh"} + if stdout, stderr, err := tc.RunCommandOnNode(0, line); err != nil { + t.Fatalf("fail to check post-restore state: %v: %s: %s", err, stdout, stderr) + } + appUpgradeVersion := fmt.Sprintf("appver-%s-upgrade", os.Getenv("SHORT_SHA")) testArgs = []string{appUpgradeVersion} @@ -914,5 +932,11 @@ func TestMultiNodeAirgapHADisasterRecovery(t *testing.T) { t.Fatalf("fail to check post ha state: %v", err) } + t.Logf("%s: checking post-restore state", time.Now().Format(time.RFC3339)) + line = []string{"check-post-restore.sh"} + if stdout, stderr, err := tc.RunCommandOnNode(0, line); err != nil { + t.Fatalf("fail to check post-restore state: %v: %s: %s", err, stdout, stderr) + } + t.Logf("%s: test complete", time.Now().Format(time.RFC3339)) } From 46537a18b3db823ff68e4263899ee870d2a68d12 Mon Sep 17 00:00:00 2001 From: Ethan Mosbaugh Date: Tue, 17 Dec 2024 14:33:11 -0800 Subject: [PATCH 05/14] f --- e2e/kots-release-install/backup.yaml | 1 + e2e/kots-release-upgrade/backup.yaml | 1 + 2 files changed, 2 insertions(+) diff --git a/e2e/kots-release-install/backup.yaml b/e2e/kots-release-install/backup.yaml index 0ba4108a6..571b561a5 100644 --- a/e2e/kots-release-install/backup.yaml +++ b/e2e/kots-release-install/backup.yaml @@ -11,6 +11,7 @@ spec: orLabelSelectors: - matchExpressions: - { key: kots.io/backup, operator: DoesNotExist } + - matchExpressions: - { key: replicated.com/disaster-recovery, operator: DoesNotExist } hooks: resources: diff --git a/e2e/kots-release-upgrade/backup.yaml b/e2e/kots-release-upgrade/backup.yaml index 0ba4108a6..571b561a5 100644 --- a/e2e/kots-release-upgrade/backup.yaml +++ b/e2e/kots-release-upgrade/backup.yaml @@ -11,6 +11,7 @@ spec: orLabelSelectors: - matchExpressions: - { key: kots.io/backup, operator: DoesNotExist } + - matchExpressions: - { key: replicated.com/disaster-recovery, operator: DoesNotExist } hooks: resources: From 0628accaa98f4a9ca53d13bb232241f7abf5fb13 Mon Sep 17 00:00:00 2001 From: Ethan Mosbaugh Date: Tue, 17 Dec 2024 14:35:34 -0800 Subject: [PATCH 06/14] f --- e2e/kots-release-install/backup.yaml | 1 - e2e/kots-release-upgrade/backup.yaml | 1 - 2 files changed, 2 deletions(-) diff --git a/e2e/kots-release-install/backup.yaml b/e2e/kots-release-install/backup.yaml index 571b561a5..0ba4108a6 100644 --- a/e2e/kots-release-install/backup.yaml +++ b/e2e/kots-release-install/backup.yaml @@ -11,7 +11,6 @@ spec: orLabelSelectors: - matchExpressions: - { key: kots.io/backup, operator: DoesNotExist } - - matchExpressions: - { key: replicated.com/disaster-recovery, operator: DoesNotExist } hooks: resources: diff --git a/e2e/kots-release-upgrade/backup.yaml b/e2e/kots-release-upgrade/backup.yaml index 571b561a5..0ba4108a6 100644 --- a/e2e/kots-release-upgrade/backup.yaml +++ b/e2e/kots-release-upgrade/backup.yaml @@ -11,7 +11,6 @@ spec: orLabelSelectors: - matchExpressions: - { key: kots.io/backup, operator: DoesNotExist } - - matchExpressions: - { key: replicated.com/disaster-recovery, operator: DoesNotExist } hooks: resources: From 70111210addba9baedef6a906ed620c43acfea04 Mon Sep 17 00:00:00 2001 From: Ethan Mosbaugh Date: Tue, 17 Dec 2024 14:50:34 -0800 Subject: [PATCH 07/14] f --- e2e/kots-release-install/backup.yaml | 2 +- e2e/kots-release-upgrade/backup.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/e2e/kots-release-install/backup.yaml b/e2e/kots-release-install/backup.yaml index 0ba4108a6..77edf5e36 100644 --- a/e2e/kots-release-install/backup.yaml +++ b/e2e/kots-release-install/backup.yaml @@ -10,7 +10,7 @@ spec: - kotsadm orLabelSelectors: - matchExpressions: - - { key: kots.io/backup, operator: DoesNotExist } + - { key: kots.io/kotsadm, operator: NotIn, values: ["true"] } - { key: replicated.com/disaster-recovery, operator: DoesNotExist } hooks: resources: diff --git a/e2e/kots-release-upgrade/backup.yaml b/e2e/kots-release-upgrade/backup.yaml index 0ba4108a6..77edf5e36 100644 --- a/e2e/kots-release-upgrade/backup.yaml +++ b/e2e/kots-release-upgrade/backup.yaml @@ -10,7 +10,7 @@ spec: - kotsadm orLabelSelectors: - matchExpressions: - - { key: kots.io/backup, operator: DoesNotExist } + - { key: kots.io/kotsadm, operator: NotIn, values: ["true"] } - { key: replicated.com/disaster-recovery, operator: DoesNotExist } hooks: resources: From d02101a41cac818cc5c4dca4a99d492d364d2adf Mon Sep 17 00:00:00 2001 From: Ethan Mosbaugh Date: Tue, 17 Dec 2024 15:31:42 -0800 Subject: [PATCH 08/14] missing kots labels --- e2e/kots-release-install/backup.yaml | 1 - e2e/kots-release-upgrade/backup.yaml | 1 - e2e/playwright/README.md | 1 + e2e/scripts/bypass-kurl-proxy.sh | 1 + pkg/kotscli/kotscli.go | 1 + 5 files changed, 3 insertions(+), 2 deletions(-) diff --git a/e2e/kots-release-install/backup.yaml b/e2e/kots-release-install/backup.yaml index 77edf5e36..e18a780d4 100644 --- a/e2e/kots-release-install/backup.yaml +++ b/e2e/kots-release-install/backup.yaml @@ -11,7 +11,6 @@ spec: orLabelSelectors: - matchExpressions: - { key: kots.io/kotsadm, operator: NotIn, values: ["true"] } - - { key: replicated.com/disaster-recovery, operator: DoesNotExist } hooks: resources: - name: test-hook diff --git a/e2e/kots-release-upgrade/backup.yaml b/e2e/kots-release-upgrade/backup.yaml index 77edf5e36..e18a780d4 100644 --- a/e2e/kots-release-upgrade/backup.yaml +++ b/e2e/kots-release-upgrade/backup.yaml @@ -11,7 +11,6 @@ spec: orLabelSelectors: - matchExpressions: - { key: kots.io/kotsadm, operator: NotIn, values: ["true"] } - - { key: replicated.com/disaster-recovery, operator: DoesNotExist } hooks: resources: - name: test-hook diff --git a/e2e/playwright/README.md b/e2e/playwright/README.md index b045a4c2d..eda6d3308 100644 --- a/e2e/playwright/README.md +++ b/e2e/playwright/README.md @@ -28,6 +28,7 @@ labels: replicated.com/disaster-recovery: infra replicated.com/disaster-recovery-chart: admin-console + kots.io/kotsadm: "true" spec: type: NodePort ports: diff --git a/e2e/scripts/bypass-kurl-proxy.sh b/e2e/scripts/bypass-kurl-proxy.sh index fd877ff24..e8a4e1e7b 100755 --- a/e2e/scripts/bypass-kurl-proxy.sh +++ b/e2e/scripts/bypass-kurl-proxy.sh @@ -15,6 +15,7 @@ main() { labels: replicated.com/disaster-recovery: infra replicated.com/disaster-recovery-chart: admin-console + kots.io/kotsadm: "true" spec: type: NodePort ports: diff --git a/pkg/kotscli/kotscli.go b/pkg/kotscli/kotscli.go index 5335bf7b0..98ff30374 100644 --- a/pkg/kotscli/kotscli.go +++ b/pkg/kotscli/kotscli.go @@ -339,6 +339,7 @@ func CreateHostSupportBundle() error { Namespace: "kotsadm", Labels: map[string]string{ "troubleshoot.sh/kind": "support-bundle", + "kots.io/kotsadm": "true", "replicated.com/disaster-recovery": "infra", "replicated.com/disaster-recovery-chart": "admin-console", }, From b527393c6228160d87fad1ba832f43d5d792d9e9 Mon Sep 17 00:00:00 2001 From: Ethan Mosbaugh Date: Tue, 17 Dec 2024 15:33:44 -0800 Subject: [PATCH 09/14] f --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 80c7946a8..4d4ca16b2 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -684,7 +684,7 @@ jobs: - TestMultiNodeInstallation - TestMultiNodeHAInstallation - TestSingleNodeDisasterRecovery - - TestSingleNodeNewDisasterRecovery + - TestSingleNodeLegacyDisasterRecovery - TestSingleNodeResumeDisasterRecovery - TestMultiNodeHADisasterRecovery - TestSingleNodeInstallationNoopUpgrade From 4b0a7a7df8a312e22c06d1ec9ac4ab91aa3e1d53 Mon Sep 17 00:00:00 2001 From: Ethan Mosbaugh Date: Wed, 18 Dec 2024 06:11:47 -0800 Subject: [PATCH 10/14] f --- e2e/install_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/e2e/install_test.go b/e2e/install_test.go index 9336c1274..0fc46d383 100644 --- a/e2e/install_test.go +++ b/e2e/install_test.go @@ -882,6 +882,10 @@ func TestOldVersionUpgrade(t *testing.T) { line = []string{"kots-upstream-upgrade.sh", os.Getenv("SHORT_SHA")} if stdout, stderr, err := tc.RunCommandOnNode(0, line, withEnv); err != nil { t.Fatalf("fail to run kots upstream upgrade: %v: %s: %s", err, stdout, stderr) + } else { + t.Log(stdout) + t.Log(stderr) + t.Logf("%s: ran kots upstream upgrade", time.Now().Format(time.RFC3339)) } t.Logf("%s: checking installation state after upgrade", time.Now().Format(time.RFC3339)) From 1baadee6bcc28dffccb8b706aa7f3d01f5aece1c Mon Sep 17 00:00:00 2001 From: Ethan Mosbaugh Date: Wed, 18 Dec 2024 10:02:43 -0800 Subject: [PATCH 11/14] f --- e2e/install_test.go | 4 ---- 1 file changed, 4 deletions(-) diff --git a/e2e/install_test.go b/e2e/install_test.go index 0fc46d383..9336c1274 100644 --- a/e2e/install_test.go +++ b/e2e/install_test.go @@ -882,10 +882,6 @@ func TestOldVersionUpgrade(t *testing.T) { line = []string{"kots-upstream-upgrade.sh", os.Getenv("SHORT_SHA")} if stdout, stderr, err := tc.RunCommandOnNode(0, line, withEnv); err != nil { t.Fatalf("fail to run kots upstream upgrade: %v: %s: %s", err, stdout, stderr) - } else { - t.Log(stdout) - t.Log(stderr) - t.Logf("%s: ran kots upstream upgrade", time.Now().Format(time.RFC3339)) } t.Logf("%s: checking installation state after upgrade", time.Now().Format(time.RFC3339)) From 4c4cccf1fd2b6afbc29ddb2c63f03d0b2e7d9378 Mon Sep 17 00:00:00 2001 From: Ethan Mosbaugh Date: Wed, 18 Dec 2024 11:45:33 -0800 Subject: [PATCH 12/14] f --- e2e/restore_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/e2e/restore_test.go b/e2e/restore_test.go index 86007ee4e..dc5c8c067 100644 --- a/e2e/restore_test.go +++ b/e2e/restore_test.go @@ -934,7 +934,7 @@ func TestMultiNodeAirgapHADisasterRecovery(t *testing.T) { t.Logf("%s: checking post-restore state", time.Now().Format(time.RFC3339)) line = []string{"check-post-restore.sh"} - if stdout, stderr, err := tc.RunCommandOnNode(0, line); err != nil { + if stdout, stderr, err := tc.RunCommandOnNode(0, line, withEnv); err != nil { t.Fatalf("fail to check post-restore state: %v: %s: %s", err, stdout, stderr) } From d2777708acb8aab157ab51b6ab2020c4a3832b44 Mon Sep 17 00:00:00 2001 From: Ethan Mosbaugh Date: Wed, 18 Dec 2024 11:46:52 -0800 Subject: [PATCH 13/14] f --- e2e/restore_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/e2e/restore_test.go b/e2e/restore_test.go index dc5c8c067..b1d4d8f82 100644 --- a/e2e/restore_test.go +++ b/e2e/restore_test.go @@ -272,7 +272,7 @@ func TestSingleNodeDisasterRecoveryWithProxy(t *testing.T) { t.Logf("%s: checking post-restore state", time.Now().Format(time.RFC3339)) line = []string{"check-post-restore.sh"} - if stdout, stderr, err := tc.RunCommandOnNode(0, line); err != nil { + if stdout, stderr, err := tc.RunCommandOnNode(0, line, lxd.WithProxyEnv(tc.IPs)); err != nil { t.Fatalf("fail to check post-restore state: %v: %s: %s", err, stdout, stderr) } From eaa3d29e28eb05161c4bb972577165ba93fa14a9 Mon Sep 17 00:00:00 2001 From: Ethan Mosbaugh Date: Wed, 18 Dec 2024 11:47:15 -0800 Subject: [PATCH 14/14] f --- e2e/restore_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/e2e/restore_test.go b/e2e/restore_test.go index b1d4d8f82..dc5c8c067 100644 --- a/e2e/restore_test.go +++ b/e2e/restore_test.go @@ -272,7 +272,7 @@ func TestSingleNodeDisasterRecoveryWithProxy(t *testing.T) { t.Logf("%s: checking post-restore state", time.Now().Format(time.RFC3339)) line = []string{"check-post-restore.sh"} - if stdout, stderr, err := tc.RunCommandOnNode(0, line, lxd.WithProxyEnv(tc.IPs)); err != nil { + if stdout, stderr, err := tc.RunCommandOnNode(0, line); err != nil { t.Fatalf("fail to check post-restore state: %v: %s: %s", err, stdout, stderr) }