# cka-sim shell setup. Sourced automatically by the terminal in ./exam web,
# and safe to source yourself:   source ./examrc
[ -f ~/.bashrc ] && . ~/.bashrc

alias k=kubectl
export do='--dry-run=client -o yaml'      # k create deploy x --image=nginx $do > x.yaml
export now='--force --grace-period 0'     # k delete pod x $now
export KUBE_EDITOR="${KUBE_EDITOR:-vi}"

# completion, including for the alias
source <(kubectl completion bash) 2>/dev/null
complete -o default -F __start_kubectl k 2>/dev/null

# vim defaults that make pasted YAML behave
if [ ! -f ~/.vimrc ]; then
  printf 'set tabstop=2\nset expandtab\nset shiftwidth=2\n' > ~/.vimrc
fi
