Last active
June 12, 2023 10:28
-
-
Save darktempla/a5fbc0c55cbcc23c513b42536ce529ce to your computer and use it in GitHub Desktop.
Extract a value from a JSON payload that contains a dot in the key name using the JQ command line tool
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
# the leading '.' in the dockerconfigfile key we are interested in | |
# makes the syntax harder then it should be, pay attention to the syntax used here | |
kubectl get secret/regcred -o json | jq -r '.data[".dockerconfigjson"]' | base64 -d | |
# OR | |
kubectl get secret/regcred -o jsonapath="{.data.\.dockerconfigjson}" | base64 -d |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment