forked from rook/rook
we are adding new linter for shellcheck. As we are writing more shell scripts this will help maintain quality. Also, doing all the changes required in bash files to pass this shellcheck. Closes: https://github.com/rook/rook/issues/8431 Signed-off-by: subhamkrai <srai@redhat.com>
16 lines
470 B
Bash
Executable File
16 lines
470 B
Bash
Executable File
#!/bin/bash
|
|
# Original script found at: https://github.com/morvencao/kube-mutating-webhook-tutorial/blob/master/deployment/webhook-patch-ca-bundle.sh
|
|
|
|
set -o errexit
|
|
set -o nounset
|
|
set -o pipefail
|
|
|
|
CA_BUNDLE=$(kubectl get configmap -n kube-system extension-apiserver-authentication -o=jsonpath='{.data.client-ca-file}' | base64 | tr -d '\n')
|
|
export CA_BUNDLE
|
|
|
|
if command -v envsubst >/dev/null 2>&1; then
|
|
envsubst
|
|
else
|
|
sed -e "s|\${CA_BUNDLE}|${CA_BUNDLE}|g"
|
|
fi
|