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