Merge pull request #1215 from vmware-tanzu/prepare_supervisor_on_kind_linux

fix usage of base64 in hack script for linux
This commit is contained in:
Ryan Richard 2022-06-29 10:51:16 -07:00 committed by GitHub
commit 8a23f244f3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 1 deletions

View File

@ -254,6 +254,13 @@ EOF
--dry-run=client --output yaml | kubectl apply -f -
fi
if [[ "$OSTYPE" == "darwin"* ]]; then
certificateAuthorityData=$(cat "$root_ca_crt_path" | base64)
else
# Linux base64 requires an extra flag to keep the output on one line.
certificateAuthorityData=$(cat "$root_ca_crt_path" | base64 -w 0)
fi
# Make a JWTAuthenticator which respects JWTs from the Supervisor's issuer.
# The issuer URL must be accessible from within the cluster for OIDC discovery.
cat <<EOF | kubectl apply -f -
@ -265,7 +272,7 @@ spec:
issuer: $issuer
audience: $audience
tls:
certificateAuthorityData: $(cat "$root_ca_crt_path" | base64)
certificateAuthorityData: $certificateAuthorityData
EOF
echo "Waiting for JWTAuthenticator to initialize..."