Last active
November 5, 2023 14:13
-
-
Save cornfeedhobo/a66141dc5e99cee579aeabcfb72b03df to your computer and use it in GitHub Desktop.
Retrieve helm deployment json from a provided secret name
This file contains hidden or 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
#!/usr/bin/env bash | |
if [ $# -ne 1 ]; then | |
cat >&2 <<-USAGE | |
Usage: $0 <namespace>/<secret> | |
Example: $0 cert-manager/sh.helm.release.v1.cert-manager.v1 | |
USAGE | |
exit 1 | |
fi | |
namespace="$(cut -d'/' -f1 <<<"${1}")" | |
name="$(cut -d'/' -f2 <<<"${1}")" | |
exec kubectl get secret \ | |
-n "$namespace" "$name" \ | |
-o jsonpath='{ .data.release }' | | |
base64 -d | | |
base64 -d | | |
gunzip -c |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment