Skip to content

Commit

Permalink
f
Browse files Browse the repository at this point in the history
  • Loading branch information
emosbaugh committed Jan 31, 2025
1 parent 9fb700c commit e74b4af
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 4 deletions.
8 changes: 4 additions & 4 deletions e2e/install_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1284,8 +1284,8 @@ func TestAirgapUpgradeFromEC18(t *testing.T) {
}

t.Logf("%s: running second airgap update", time.Now().Format(time.RFC3339))
line = []string{"/usr/local/bin/embedded-cluster-upgrade2", "update", "--airgap-bundle", "/assets/upgrade2/release.airgap"}
if _, _, err := tc.RunCommandOnNode(0, line); err != nil {
line = []string{"airgap-update2.sh"}
if _, _, err := tc.RunCommandOnNode(0, line, withEnv); err != nil {
t.Fatalf("fail to run airgap update: %v", err)
}
// remove the airgap bundle and binary after upgrade
Expand Down Expand Up @@ -1787,8 +1787,8 @@ func TestMultiNodeAirgapUpgradePreviousStable(t *testing.T) {
}

t.Logf("%s: running second airgap update", time.Now().Format(time.RFC3339))
line = []string{"/usr/local/bin/embedded-cluster-upgrade2", "update", "--airgap-bundle", "/assets/upgrade2/release.airgap"}
if _, _, err := tc.RunCommandOnNode(0, line); err != nil {
line = []string{"airgap-update2.sh"}
if _, _, err := tc.RunCommandOnNode(0, line, withEnv); err != nil {

Check failure on line 1791 in e2e/install_test.go

View workflow job for this annotation

GitHub Actions / E2E docker (TestSingleNodeInstallation)

undefined: withEnv

Check failure on line 1791 in e2e/install_test.go

View workflow job for this annotation

GitHub Actions / E2E (TestVersion)

undefined: withEnv

Check failure on line 1791 in e2e/install_test.go

View workflow job for this annotation

GitHub Actions / E2E docker (TestSingleNodeUpgradePreviousStable)

undefined: withEnv

Check failure on line 1791 in e2e/install_test.go

View workflow job for this annotation

GitHub Actions / E2E (TestCommandsRequireSudo)

undefined: withEnv

Check failure on line 1791 in e2e/install_test.go

View workflow job for this annotation

GitHub Actions / E2E docker (TestUpgradeEC18FromReplicatedApp)

undefined: withEnv

Check failure on line 1791 in e2e/install_test.go

View workflow job for this annotation

GitHub Actions / E2E (TestResetAndReinstallAirgap)

undefined: withEnv
t.Fatalf("fail to run airgap update: %v", err)
}
// remove the airgap bundle and binary after upgrade
Expand Down
29 changes: 29 additions & 0 deletions e2e/scripts/airgap-prepare.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,35 @@ main() {
exit 1
fi

if [ -e /assets/ec-release-upgrade.tgz ]
then
mkdir -p upgrade
tar xzf /assets/ec-release-upgrade.tgz -C upgrade

mv upgrade/embedded-cluster-smoke-test-staging-app /usr/local/bin/embedded-cluster-upgrade
mkdir -p /assets/upgrade
mv upgrade/license.yaml /assets/upgrade/license.yaml

for file in upgrade/*.airgap;
do
if [ -e "$file" ]
then
mv "$file" /assets/upgrade/release.airgap
break
fi
done

# if there is no file at /assets/upgrade/release.airgap, this is an error
if [ ! -e /assets/upgrade/release.airgap ]
then
echo "No upgrade airgap file found"
exit 1
fi

# delete the ec upgrade airgap release
rm /assets/ec-release-upgrade.tgz
fi

if [ -e /assets/ec-release-upgrade2.tgz ]
then
mkdir -p upgrade2
Expand Down
12 changes: 12 additions & 0 deletions e2e/scripts/airgap-update2.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env bash
set -euox pipefail

DIR=/usr/local/bin
. $DIR/common.sh

main() {
echo "upgrading from airgap bundle"
embedded-cluster-upgrade2 update --airgap-bundle /assets/upgrade2/release.airgap
}

main "$@"
Empty file modified e2e/scripts/common.sh
100644 → 100755
Empty file.

0 comments on commit e74b4af

Please sign in to comment.