mirror of https://github.com/k3s-io/k3s
Do not depend on metadata server for auth
parent
8635d27cf1
commit
41a23d6521
|
@ -226,7 +226,7 @@ fi
|
||||||
if [[ -f "${KUBEKINS_SERVICE_ACCOUNT_FILE:-}" ]]; then
|
if [[ -f "${KUBEKINS_SERVICE_ACCOUNT_FILE:-}" ]]; then
|
||||||
echo 'Activating service account...' # No harm in doing this multiple times.
|
echo 'Activating service account...' # No harm in doing this multiple times.
|
||||||
gcloud auth activate-service-account --key-file="${KUBEKINS_SERVICE_ACCOUNT_FILE}"
|
gcloud auth activate-service-account --key-file="${KUBEKINS_SERVICE_ACCOUNT_FILE}"
|
||||||
export GCE_SERVICE_ACCOUNT=$(gcloud auth list 2> /dev/null | grep active | cut -f3 -d' ')
|
unset GCE_SERVICE_ACCOUNT # Use checked in credentials, not the metadata server
|
||||||
unset KUBEKINS_SERVICE_ACCOUNT_FILE
|
unset KUBEKINS_SERVICE_ACCOUNT_FILE
|
||||||
elif [[ -n "${KUBEKINS_SERVICE_ACCOUNT_FILE:-}" ]]; then
|
elif [[ -n "${KUBEKINS_SERVICE_ACCOUNT_FILE:-}" ]]; then
|
||||||
echo "ERROR: cannot access service account file at: ${KUBEKINS_SERVICE_ACCOUNT_FILE}"
|
echo "ERROR: cannot access service account file at: ${KUBEKINS_SERVICE_ACCOUNT_FILE}"
|
||||||
|
|
Loading…
Reference in New Issue