Skip to content

Commit

Permalink
fixes for K8s version selection
Browse files Browse the repository at this point in the history
  • Loading branch information
Xtigyro committed Oct 1, 2022
1 parent f7aa7c5 commit ea5deab
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions bin/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ LIGHT_RED='\033[1;31m'
NC='\033[0m' # No Color
INSTALL_CMD='false'
DOCKER_PKG='false'
REQ_BINS=(docker curl wget bash)
REQ_BINS=(docker curl wget bash jq)

# Check req. pkgs
OS_ID=$(awk -F= '/^ID=/{print $2}' /etc/os-release)
Expand All @@ -33,7 +33,7 @@ elif [ "$OS_ID" == "ubuntu" ] || [ "$OS_ID" == "debian" ] ; then
fi

# check and advise on missing prerequisite os pkgs
REQ_PKGS=("$DOCKER_PKG" curl wget bash)
REQ_PKGS=("$DOCKER_PKG" curl wget bash jq)
for ((i=0;i<"${#REQ_BINS[@]}";i++)); do
if ! `command -v "${REQ_BINS[i]}" >/dev/null 2>&1` ; then
if [[ "$INSTALL_CMD" != 'false' ]] ; then
Expand Down
3 changes: 2 additions & 1 deletion kindadm
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,8 @@ while [ $# -gt 0 ]; do
fi
;;
--k8s_ver=*|-v=*)
declare -A k8s_vers_avail="$(wget -q https://registry.hub.docker.com/v1/repositories/kindest/node/tags -O - | sed -e 's/[][]//g' -e 's/"//g' -e 's/ //g' | tr '}' '\n' | awk -F: '{print $3}' | tr -d 'v')"
# declare -A k8s_vers_avail="$(wget -q https://registry.hub.docker.com/v1/repositories/kindest/node/tags -O - | sed -e 's/[][]//g' -e 's/"//g' -e 's/ //g' | tr '}' '\n' | awk -F: '{print $3}' | tr -d 'v')"
declare -A k8s_vers_avail="$(wget -q https://registry.hub.docker.com/v2/repositories/kindest/node/tags?page_size=100 -O - | jq '."results"[]["name"]' )"
if ! [[ "${k8s_vers_avail[@]}" =~ "${1#*=}" ]]; then
printf "\nUnsupported K8s node version.\nSupported versions:\n"
printf '%s\n' "${k8s_vers_avail[*]}" | paste -sd ','
Expand Down

0 comments on commit ea5deab

Please sign in to comment.