Last active
July 7, 2024 08:40
-
-
Save welshstew/ed30310a96103aa5c665768fda680c64 to your computer and use it in GitHub Desktop.
use jq to pull base 64 things out of a secret and construct them to file
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
#pull a base64 encoded files out of a kubernetes json secret | |
oc get secrets/broker-client-secret -o json | jq -r '.data."client.ts"' | base64 -d > client.ts | |
oc get secrets/broker-server-secret -o json | jq -r '.data."broker.ks"' | base64 -d > broker.ks | |
oc get secrets/broker-server-secret -o json | jq -r '.data."broker.ts"' | base64 -d > broker.ts | |
#replace base64 content in a secret - and save to file | |
THINGY=$(base64 newbroker.ks) | |
oc get secrets/il3-broker-server-secret -o json | jq -r --arg THINGY $THINGY '.data."broker.ks" = $THINGY' > my-new-secret.json |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment