Skip to content

Commit

Permalink
debug
Browse files Browse the repository at this point in the history
  • Loading branch information
FuhuXia committed Oct 12, 2023
1 parent 0f08593 commit b72dc2f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions generate-examples.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,22 @@

# BASH templating, courtesy of
# https://stackoverflow.com/a/14870510
echo "*********************"

CURRENT_CONTEXT=$(kubectl config current-context)
echo 1;
CLUSTER_CA_CERTIFICATE=$(kubectl config view --raw -o json | jq -r '.clusters[]| select(.name | contains("'${CURRENT_CONTEXT}'")) .cluster["certificate-authority-data"]')
TOKEN=$(kubectl get secret $( kubectl get serviceaccount default -n default -o json | jq -r '.secrets[0].name' ) -n default -o json | jq -r .data.token)

echo 2;
CURRENT_CLUSTER=$(kubectl config view --raw -o json | jq -r '.contexts[]| select(.name | contains("'${CURRENT_CONTEXT}'")) .context.cluster')
SERVER=$(kubectl config view --raw -o json | jq -r '.clusters[]| select(.name | contains("'${CURRENT_CLUSTER}'")) .cluster["server"]')

echo 3;
template() {
file=examples.json-template
eval "`printf 'local %s\n' $@`
cat <<EOF
`cat $file`
EOF"
}

echo 4;
template

0 comments on commit b72dc2f

Please sign in to comment.