Merge pull request #28634 from fejta/auth

Automatic merge from submit-queue

Activate a service account if this is defined

For https://github.com/kubernetes/test-infra/issues/266 and https://github.com/kubernetes/kubernetes/issues/28612

This will activate a service account if the service account file exists.
This commit is contained in:
k8s-merge-robot
2016-07-08 23:17:45 -07:00
committed by GitHub

View File

@@ -151,6 +151,11 @@ if running_in_docker; then
fi
fi
if [[ -n "${KUBEKINS_SERVICE_ACCOUNT_FILE:-}" ]]; then
echo 'Activating service account...' # No harm in doing this multiple times.
gcloud auth activate-service-account --key-file="${KUBEKINS_SERVICE_ACCOUNT_FILE}"
fi
# Install gcloud from a custom path if provided. Used to test GKE with gcloud
# at HEAD, release candidate.
# TODO: figure out how to avoid installing the cloud sdk twice if run inside Docker.