From 3e1c5199b7388053a0f8b599daa95ebdfce273ba Mon Sep 17 00:00:00 2001 From: kfox1111 Date: Wed, 24 Jan 2024 08:02:31 -0800 Subject: [PATCH] Always upgrade test from the previous major release (#207) --- examples/production/run-tests.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/examples/production/run-tests.sh b/examples/production/run-tests.sh index 595b96b..bd67728 100755 --- a/examples/production/run-tests.sh +++ b/examples/production/run-tests.sh @@ -2,7 +2,7 @@ set -xe -UPGRADE_VERSION=v0.15.1 +UPGRADE_VERSION=$(git ls-remote --tags origin -l 'spire-0.*' | awk -F. '{print $2}' | sort -n | tail -n 1 | sed 's/^/v0./; s/$/.0/') UPGRADE_REPO=https://spiffe.github.io/helm-charts-hardened SCRIPT="$(readlink -f "$0")" @@ -24,6 +24,10 @@ CLEANUP=1 for i in "$@"; do case $i in -u) + if [[ -z "$UPGRADE_VERSION" ]]; then + echo "Failed to detect previous version." + exit 1 + fi UPGRADE_ARGS="--repo $UPGRADE_REPO --version $UPGRADE_VERSION" shift # past argument=value ;;