You've already forked personal-linux-config
feat(kubernetes): Guard kubectl initialization and completions
Ensures kubectl-related aliases and functions are only sourced if the `kubectl` command is available.
This commit is contained in:
@@ -1,3 +1,4 @@
|
|||||||
|
if command -v kubectl >/dev/null 2>&1; then
|
||||||
source <(kubectl completion bash)
|
source <(kubectl completion bash)
|
||||||
alias k="kubectl"
|
alias k="kubectl"
|
||||||
alias kcontext="kubectl config use-context"
|
alias kcontext="kubectl config use-context"
|
||||||
@@ -23,3 +24,4 @@ _kcontext_completion() {
|
|||||||
complete -F __start_kubectl k
|
complete -F __start_kubectl k
|
||||||
complete -F _kns_completion kns
|
complete -F _kns_completion kns
|
||||||
complete -F _kcontext_completion kcontext
|
complete -F _kcontext_completion kcontext
|
||||||
|
fi
|
||||||
Reference in New Issue
Block a user