diff --git a/bin/setup.sh b/bin/setup.sh index 36abbe2..0ef55b0 100644 --- a/bin/setup.sh +++ b/bin/setup.sh @@ -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) @@ -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 diff --git a/kindadm b/kindadm index 13d1a26..846c854 100755 --- a/kindadm +++ b/kindadm @@ -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 ','