fix usage of base64 in hack script

This commit is contained in:
Ryan Richard 2022-06-28 12:44:41 -07:00
parent 4878ae77e5
commit 5b0c165dc8

View File

@ -254,6 +254,13 @@ EOF
--dry-run=client --output yaml | kubectl apply -f - --dry-run=client --output yaml | kubectl apply -f -
fi 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. # Make a JWTAuthenticator which respects JWTs from the Supervisor's issuer.
# The issuer URL must be accessible from within the cluster for OIDC discovery. # The issuer URL must be accessible from within the cluster for OIDC discovery.
cat <<EOF | kubectl apply -f - cat <<EOF | kubectl apply -f -
@ -265,7 +272,7 @@ spec:
issuer: $issuer issuer: $issuer
audience: $audience audience: $audience
tls: tls:
certificateAuthorityData: $(cat "$root_ca_crt_path" | base64) certificateAuthorityData: $certificateAuthorityData
EOF EOF
echo "Waiting for JWTAuthenticator to initialize..." echo "Waiting for JWTAuthenticator to initialize..."