Skip to content

Commit

Permalink
fix some upgrade scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
anlutro committed Jul 12, 2024
1 parent 11e0c34 commit 1996f55
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 3 additions & 1 deletion scripts/upgrade/helm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@ set -eu
. "$(dirname "$(realpath "$0")")/_lib.sh"

repo=helm/helm
version="$1"
version="${1-}"
if [ -z "$version" ]; then
# exclude alpha/beta/rc, and always get highest version number (as opposed to
# most recent release by date)
version=$(gh_tags $repo | grep -P '\d+\.\d+$' | sort -V | tail -1)
fi
# strip "v" prefix
version=$(echo "$version" | grep -oP '\d+\.\d+')

if helm version --template '{{.Version}}' | grep -qFx "$version"; then
latest_already_installed
Expand Down
6 changes: 5 additions & 1 deletion scripts/upgrade/kubectl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@ set -eu
# shellcheck source=_lib.sh
. "$(dirname "$(realpath "$0")")/_lib.sh"

version=$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)
if [ -n "${1-}" ]; then
version=$1
else
version=$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)
fi

if kubectl version --client --short | grep -q "$version\$"; then
latest_already_installed
Expand Down

0 comments on commit 1996f55

Please sign in to comment.