Created
June 12, 2024 08:53
-
-
Save jk/ebd7f60561b9543378cc20fb4bfd02c9 to your computer and use it in GitHub Desktop.
Get a sorted list of kubectl get shortnames
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
kubectl api-resources --no-headers | awk -F' ' '{if (NF == 5) {shortname=$2; name=$1; kind=$5} else if (NF == 4) {shortname=""; name=$1; kind=$4} else {shortname=$2; name=$1; kind=$4} if (shortname != "") print shortname "\t" name "\t" kind}' | sort | uniq | column -t |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment