mirror of https://gitlab.com/dabruh/dotfiles.git
Implement kubectl-krew support
This commit is contained in:
parent
279fcecbf1
commit
6ad6cf3504
|
@ -13,3 +13,5 @@ apt-laptop:brightnessctl
|
||||||
|
|
||||||
apt-any:libxcb-render0-dev,libffi-dev,python3-dev,python3-cffi
|
apt-any:libxcb-render0-dev,libffi-dev,python3-dev,python3-cffi
|
||||||
pip-any:flashfocus
|
pip-any:flashfocus
|
||||||
|
|
||||||
|
krew-any:ctx,krew,ns,slice,stern,tree
|
||||||
|
|
|
@ -130,6 +130,30 @@ function install_picom() {
|
||||||
rm -Rf "$tmp"
|
rm -Rf "$tmp"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function setup_krew_plugins() {
|
||||||
|
local targets=("krew-any") packages
|
||||||
|
|
||||||
|
if ! command -v kubectl-krew >/dev/null; then
|
||||||
|
echo "WARN: Krew not installed: kubectl-krew"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
for package in $(get_packages "${targets[@]}"); do
|
||||||
|
if kubectl-krew list | grep -q "^$package$" >/dev/null; then
|
||||||
|
if $UPGRADE_PACKAGES; then
|
||||||
|
echo "Package '$package' will be upgraded."
|
||||||
|
else
|
||||||
|
echo "Package '$package' already exists."
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "Package '$package' will be installed."
|
||||||
|
fi
|
||||||
|
|
||||||
|
kubectl-krew install "$package" || return 2
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
#
|
#
|
||||||
# Setup for Arch-like systems
|
# Setup for Arch-like systems
|
||||||
#
|
#
|
||||||
|
@ -183,6 +207,7 @@ function setup_arch() {
|
||||||
setup_arch_with_pip || return 4
|
setup_arch_with_pip || return 4
|
||||||
configure_sddm || return 5
|
configure_sddm || return 5
|
||||||
configure_ufw || return 6
|
configure_ufw || return 6
|
||||||
|
setup_krew_plugins || return 7
|
||||||
}
|
}
|
||||||
|
|
||||||
#
|
#
|
||||||
|
@ -238,6 +263,7 @@ function setup_debian() {
|
||||||
setup_debian_with_git || return 4
|
setup_debian_with_git || return 4
|
||||||
configure_sddm || return 5
|
configure_sddm || return 5
|
||||||
configure_ufw || return 6
|
configure_ufw || return 6
|
||||||
|
setup_krew_plugins || return 7
|
||||||
}
|
}
|
||||||
|
|
||||||
ID_LIKE="$(grep ID_LIKE= </etc/os-release | cut -d= -f2)"
|
ID_LIKE="$(grep ID_LIKE= </etc/os-release | cut -d= -f2)"
|
||||||
|
|
Loading…
Reference in New Issue