fixed: fix-kubectl installation of tools

This commit is contained in:
Lockszmith 2023-11-15 20:01:08 -05:00
parent 3c31041ca9
commit 489050ee7e
1 changed files with 25 additions and 26 deletions

View File

@ -38,41 +38,41 @@ if [[ -z "${BASE_0}" || "${BASE_0}" == "$BASE_SHELL" ]]; then
if [[ -n "$(type -t 'kubectl-cnpg')" ]]; then if [[ -n "$(type -t 'kubectl-cnpg')" ]]; then
. <( kubectl cnpg completion ${SHELL##*/} ) . <( kubectl cnpg completion ${SHELL##*/} )
else fi
DL_VER=v1.21.1 if [[ -z "$(type -t 'kubectl-cnpg')" || -n "$UPGRADE" ]]; then
DL_VER=1.21.1
GH_URL=https://github.com/cloudnative-pg/cloudnative-pg GH_URL=https://github.com/cloudnative-pg/cloudnative-pg
DL_FILE="kubectl-cnpg_${DL_VER}_linux_x86_64.deb" DL_FILE="kubectl-cnpg_${DL_VER}_linux_x86_64.deb"
URL=${GH_URL}/releases/download/${DL_VER}/${DL_FILE} URL=${GH_URL}/releases/download/v${DL_VER}/${DL_FILE}
printf '%s\n' \ printf '%s\n' \
'To download and install cnpg kubectl plugin, run:' \ 'To download and install cnpg kubectl plugin, run:' \
" curl -sSLO ${URL}" \ " curl -sSLO ${URL}" \
" sudo dpkg -i $DL_FILE" " sudo dpkg -i $DL_FILE"
fi fi
if [[ -z "$(type -t 'kubetui')" ]]; then if [[ -z "$(type -t 'kubetui')" || -n "$UPGRADE" ]]; then
DL_VER='v1.4.2' DL_VER=1.4.2
GH_URL=https://github.com/sarub0b0/kubetui GH_URL=https://github.com/sarub0b0/kubetui
DL_FILE=kubetui-x86_64-unknown-linux-musl-rustls DL_FILE=kubetui-x86_64-unknown-linux-musl-rustls
URL=${GH_URL}/releases/download/${DL_VER}/${DL_FILE} URL=${GH_URL}/releases/download/v${DL_VER}/${DL_FILE}
printf '%s\n' \ printf '%s\n' \
'To download and install kubetui, run:' \ 'To download and install kubetui, run:' \
" curl -sSL ${URL} > ~/bin/kubetui" \ " curl -sSL ${URL} > ~/bin/kubetui" \
" chmod +x ~/bin/kubetui" " chmod +x ~/bin/kubetui"
fi fi
if [[ -z "$(type -t 'k3s')" ]]; then if [[ -z "$(type -t 'k9s')" || -n "$UPGRADE" ]]; then
printf '%s\n' \ printf '%s\n' \
'To download and install k3s, run:' \ 'To download and install k9s, run:' \
" curl -sS https://webinstall.dev/k9s | bash" " curl -sS https://webinstall.dev/k9s | bash"
fi fi
if [[ -n "$(type -t 'k3s')" ]]; then if [[ -n "$(type -t 'k3s')" ]]; then
. <( k3s completion ${SHELL##*/} ) . <( k3s completion "${SHELL##*/}" )
fi fi
if [[ -n "$(type -t 'helm')" ]]; then if [[ -n "$(type -t 'helm')" ]]; then
. <( helm completion ${SHELL##*/} 2>/dev/null ) . <( helm completion "${SHELL##*/}" 2>/dev/null )
fi fi
kg() { kg() {
@ -80,7 +80,6 @@ if [[ -z "${BASE_0}" || "${BASE_0}" == "$BASE_SHELL" ]]; then
} }
fi fi
elif [[ "$1" == '-' ]]; then elif [[ "$1" == '-' ]]; then
printf "SCRIPT_FULL_PATH='%s'\n" "${BASH_SOURCE[0]}"
cat "${BASH_SOURCE[0]}" cat "${BASH_SOURCE[0]}"
else else
SCRIPT_NAME="$BASE_0" SCRIPT_NAME="$BASE_0"