Initial commit
This commit is contained in:
17
functions/kubectl-get-all.fish
Normal file
17
functions/kubectl-get-all.fish
Normal file
@@ -0,0 +1,17 @@
|
||||
function kubectl-get-all
|
||||
set -l context
|
||||
set -l namespace
|
||||
set -l fields "API:apiVersion,TYPE:kind,NAME:metadata.name"
|
||||
|
||||
if test "$argv[1]" = -c
|
||||
set context $argv[2]
|
||||
set namespace $argv[3]
|
||||
else
|
||||
set context (kubectl config current-context)
|
||||
set namespace $argv[1]
|
||||
end
|
||||
|
||||
kubectl --context="$context" api-resources --verbs=list --namespaced -o name | grep -v events | sort | uniq | while read -l restype
|
||||
kubectl --context="$context" --namespace "$namespace" get --ignore-not-found --no-headers "$restype" -o custom-columns="$fields"
|
||||
end
|
||||
end
|
Reference in New Issue
Block a user