remove jq dependency

see https://github.com/ohmyzsh/ohmyzsh/pull/8699#issuecomment-1293588083
This commit is contained in:
Harrison Kiang 2023-05-22 12:01:32 -05:00 committed by GitHub
parent ce445772ce
commit 14f66bc624
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -83,17 +83,9 @@ alias kgseca='kubectl get secret --all-namespaces'
alias kdsec='kubectl describe secret' alias kdsec='kubectl describe secret'
alias kdelsec='kubectl delete secret' alias kdelsec='kubectl delete secret'
alias kdecsec=' alias kdecsec='
_kdecsec() { kdecsec_go_template='{{range $k,$v := .data}}{{"### "}}{{$k}}{{"\n"}}{{$v|base64decode}}{{"\n\n"}}{{end}}'
if [ $(jq --version) != "jq-1.6" ]; then alias kdecsec="kubectl get secret -o go-template='$kdecsec_go_template'"
echo "kdecsec requires jq-1.6 to use the base64d format"; unset kdecsec_go_template
unset -f _kdecsec
return 1
fi
kubectl get secret "$@" -o json | jq ".data | map_values(. | @base64d )";
unset -f _kdecsec
return 0
};
_kdecsec'
# Deployment management. # Deployment management.
alias kgd='kubectl get deployment' alias kgd='kubectl get deployment'