mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-29 06:27:05 +00:00
Merge pull request #28725 from fejta/auth
Only activate service account when file exists
This commit is contained in:
commit
a77010b3b3
@ -151,9 +151,11 @@ if running_in_docker; then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -n "${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}"
|
||||||
|
elif [[ -n "${KUBEKINS_SERVICE_ACCOUNT_FILE:-}" ]]; then
|
||||||
|
echo "ERROR: cannot access service account file at: ${KUBEKINS_SERVICE_ACCOUNT_FILE}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Install gcloud from a custom path if provided. Used to test GKE with gcloud
|
# Install gcloud from a custom path if provided. Used to test GKE with gcloud
|
||||||
|
Loading…
Reference in New Issue
Block a user