diff --git a/scripts/test-run-compat b/scripts/test-run-compat index 6e31f70dd2..87cb89c00a 100755 --- a/scripts/test-run-compat +++ b/scripts/test-run-compat @@ -29,7 +29,7 @@ export -f test-post-hook REPO=${REPO:-rancher} IMAGE_NAME=${IMAGE_NAME:-k3s} -PREVIOUS_CHANNEL=$(grep 'k8s.io/kubernetes v' go.mod | head -n1 | awk '{print $2}' | awk -F. '{print "v1." ($2 - 1)}') +PREVIOUS_CHANNEL=$(echo ${VERSION_K8S} | awk -F. '{print "v1." ($2 - 1)}') PREVIOUS_VERSION=$(curl -s https://update.k3s.io/v1-release/channels/${PREVIOUS_CHANNEL} -o /dev/null -w '%{redirect_url}' | awk -F/ '{print gensub(/\+/, "-", "g", $NF)}') STABLE_VERSION=$(curl -s https://update.k3s.io/v1-release/channels/stable -o /dev/null -w '%{redirect_url}' | awk -F/ '{print gensub(/\+/, "-", "g", $NF)}') LATEST_VERSION=$(curl -s https://update.k3s.io/v1-release/channels/latest -o /dev/null -w '%{redirect_url}' | awk -F/ '{print gensub(/\+/, "-", "g", $NF)}') diff --git a/scripts/test-run-etcd b/scripts/test-run-etcd index b1ceedf4e7..5555664829 100755 --- a/scripts/test-run-etcd +++ b/scripts/test-run-etcd @@ -14,7 +14,7 @@ export SERVER_1_ARGS="--cluster-init" REPO=${REPO:-rancher} IMAGE_NAME=${IMAGE_NAME:-k3s} -PREVIOUS_CHANNEL=$(grep 'k8s.io/kubernetes v' go.mod | head -n1 | awk '{print $2}' | awk -F. '{print "v1." ($2 - 1)}') +PREVIOUS_CHANNEL=$(echo ${VERSION_K8S} | awk -F. '{print "v1." ($2 - 1)}') PREVIOUS_VERSION=$(curl -s https://update.k3s.io/v1-release/channels/${PREVIOUS_CHANNEL} -o /dev/null -w '%{redirect_url}' | awk -F/ '{print gensub(/\+/, "-", "g", $NF)}') STABLE_VERSION=$(curl -s https://update.k3s.io/v1-release/channels/stable -o /dev/null -w '%{redirect_url}' | awk -F/ '{print gensub(/\+/, "-", "g", $NF)}') LATEST_VERSION=$(curl -s https://update.k3s.io/v1-release/channels/latest -o /dev/null -w '%{redirect_url}' | awk -F/ '{print gensub(/\+/, "-", "g", $NF)}') diff --git a/scripts/test-run-upgrade b/scripts/test-run-upgrade index 5ca71b9541..203c4d61fe 100755 --- a/scripts/test-run-upgrade +++ b/scripts/test-run-upgrade @@ -13,7 +13,7 @@ export WAIT_SERVICES="${all_services[@]}" REPO=${REPO:-rancher} IMAGE_NAME=${IMAGE_NAME:-k3s} -CURRENT_CHANNEL=$(grep 'k8s.io/kubernetes v' go.mod | head -n1 | awk '{print $2}' | awk -F. '{print "v1." $2}') +CURRENT_CHANNEL=$(echo ${VERSION_K8S} | awk -F. '{print "v1." $2}') CURRENT_VERSION=$(curl -s https://update.k3s.io/v1-release/channels/${CURRENT_CHANNEL} -o /dev/null -w '%{redirect_url}' | awk -F/ '{print gensub(/\+/, "-", "g", $NF)}') if [ -z "${CURRENT_VERSION}" ]; then CURRENT_VERSION=${VERSION_TAG}