mirror of
https://github.com/jimeh/dotfiles.git
synced 2026-02-19 13:46:41 +00:00
feat(kubernetes): remove tools, simplify setup and rely on rtx
This commit is contained in:
@@ -5,6 +5,8 @@
|
|||||||
alias kc="kubectl"
|
alias kc="kubectl"
|
||||||
alias hl="helm"
|
alias hl="helm"
|
||||||
alias mk="minikube"
|
alias mk="minikube"
|
||||||
|
alias kctx="kubectx"
|
||||||
|
alias kns="kubens"
|
||||||
|
|
||||||
if command-exists kubectl; then
|
if command-exists kubectl; then
|
||||||
# lazy-load kubectl completion
|
# lazy-load kubectl completion
|
||||||
@@ -19,9 +21,6 @@ if command-exists kubectl; then
|
|||||||
switch "$@"
|
switch "$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
zinit light-mode wait lucid as'program' from'gh-r' \
|
|
||||||
for @stackrox/kube-linter
|
|
||||||
|
|
||||||
export KREW_ROOT="$HOME/.krew"
|
export KREW_ROOT="$HOME/.krew"
|
||||||
path_append "${KREW_ROOT}/bin"
|
path_append "${KREW_ROOT}/bin"
|
||||||
|
|
||||||
@@ -39,23 +38,33 @@ if command-exists kubectl; then
|
|||||||
export KREW_ROOT="$HOME/.krew"
|
export KREW_ROOT="$HOME/.krew"
|
||||||
path_append "${KREW_ROOT}/bin"
|
path_append "${KREW_ROOT}/bin"
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
zinit light-mode wait lucid as'program' from'gh-r' mv'kind-* -> kind' \
|
|
||||||
atclone'./kind completion zsh > _kind' atpull'%atclone' \
|
_setup-kubectx-completion() {
|
||||||
for @kubernetes-sigs/kind
|
local cmd="$1"
|
||||||
|
local dir="$HOME/.local/share/rtx/installs/kubectx/latest/completion/"
|
||||||
zinit light-mode wait lucid as'program' from'gh-r' \
|
|
||||||
atclone'./flux completion zsh > _flux' atpull'%atclone' \
|
if [ -f "$ZSH_COMPLETIONS/_${cmd}" ] || [ !-d "$dir" ]; then
|
||||||
for @fluxcd/flux2
|
return
|
||||||
|
fi
|
||||||
zinit light-mode wait lucid as'program' from'gh-r' \
|
|
||||||
atclone'./kustomize completion zsh > _kustomize' atpull'%atclone' \
|
echo "Setting up completion for $cmd -- $ZSH_COMPLETIONS/_${cmd}"
|
||||||
for @kubernetes-sigs/kustomize
|
|
||||||
|
local script
|
||||||
zinit light-mode wait lucid as'program' from'gh-r' pick'kubeseal' \
|
if [ -f "${dir}/${cmd}.zsh" ]; then
|
||||||
for @bitnami-labs/sealed-secrets
|
script="$dir/${cmd}.zsh"
|
||||||
|
elif [ -f "${dir}/_${cmd}.zsh" ]; then
|
||||||
zinit light-mode wait lucid as'program' from'gh-r' mv'argocd-* -> argocd' \
|
script="$dir/_${cmd}.zsh"
|
||||||
atclone'./argocd completion zsh > _argocd' atpull'%atclone' \
|
fi
|
||||||
for @argoproj/argo-cd
|
|
||||||
|
mkdir -p "$ZSH_COMPLETIONS"
|
||||||
|
ln -s "$script" "$ZSH_COMPLETIONS/_${cmd}"
|
||||||
|
}
|
||||||
|
|
||||||
|
if command-exists kubectx && ! which _kubectx &> /dev/null; then
|
||||||
|
_setup-kubectx-completion kubectx
|
||||||
|
fi
|
||||||
|
|
||||||
|
if command-exists kubens && ! which _kubens &> /dev/null; then
|
||||||
|
_setup-kubectx-completion kubens
|
||||||
fi
|
fi
|
||||||
|
|||||||
3
zshenv
3
zshenv
@@ -90,6 +90,9 @@ if [[ "$TMPDIR" == "/var/folders/"* ]] || [[ "$TMPDIR" == "" ]]; then
|
|||||||
mkdir -p "$TMPDIR"
|
mkdir -p "$TMPDIR"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
export DOTZSH_SITEFUNS="$DOTZSH/site-functions"
|
||||||
|
export ZSH_COMPLETIONS="$HOME/.local/share/zsh/completions"
|
||||||
|
|
||||||
# Ensure basic systems paths are in desired order
|
# Ensure basic systems paths are in desired order
|
||||||
path_prepend "/bin"
|
path_prepend "/bin"
|
||||||
path_prepend "/sbin"
|
path_prepend "/sbin"
|
||||||
|
|||||||
7
zshrc
7
zshrc
@@ -66,6 +66,9 @@ zstyle ':completion:*:descriptions' format '%B%d%b'
|
|||||||
zstyle ':completion:*:make:*:targets' call-command true
|
zstyle ':completion:*:make:*:targets' call-command true
|
||||||
zstyle ':completion:*:make:*' tag-order targets
|
zstyle ':completion:*:make:*' tag-order targets
|
||||||
|
|
||||||
|
if [ -d "$ZSH_COMPLETIONS" ]; then fpath=("$ZSH_COMPLETIONS" $fpath); fi
|
||||||
|
if [ -d "$DOTZSH_SITEFUNS" ]; then fpath=("$DOTZSH_SITEFUNS" $fpath); fi
|
||||||
|
|
||||||
# ==============================================================================
|
# ==============================================================================
|
||||||
# Edit command line
|
# Edit command line
|
||||||
# ==============================================================================
|
# ==============================================================================
|
||||||
@@ -167,8 +170,4 @@ if [ -f "$HOME/.zshrc.local" ]; then
|
|||||||
source "$HOME/.zshrc.local"
|
source "$HOME/.zshrc.local"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -d "$DOTZSH/site-functions" ]; then
|
|
||||||
fpath=("$DOTZSH/site-functions" $fpath)
|
|
||||||
fi
|
|
||||||
|
|
||||||
autoload -U +X bashcompinit && bashcompinit
|
autoload -U +X bashcompinit && bashcompinit
|
||||||
|
|||||||
Reference in New Issue
Block a user