Created
November 2, 2020 10:05
-
-
Save developer-guy/e80436ecb52cff730f2dad2c2be6e4b2 to your computer and use it in GitHub Desktop.
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
#!/bin/bash | |
ROOT=$(cd $(dirname $0)/../../; pwd) | |
set -o errexit | |
set -o nounset | |
set -o pipefail | |
export CA_BUNDLE=$(kubectl config view --minify --flatten -o json | jq -r '.clusters[] | select(.name == "'$(kubectl config current-context)'") | .cluster."certificate-authority-data"') | |
if command -v envsubst >/dev/null 2>&1; then | |
envsubst | |
else | |
sed -e "s|\${CA_BUNDLE}|${CA_BUNDLE}|g" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment