Don't fail test when GOOGLE_APPLICATION_CREDENTIALS is unset

Workload identity is preferred in CI instead of GOOGLE_APPLICATION_CREDENTIALS

Signed-off-by: Chao Dai <chaodai@google.com>
This commit is contained in:
Chao Dai 2022-08-17 11:39:21 -07:00
parent a04268132e
commit 13b14736a8

View File

@ -18,14 +18,10 @@
: "${PROJECT:=k8s-cri-containerd}" : "${PROJECT:=k8s-cri-containerd}"
# GOOGLE_APPLICATION_CREDENTIALS is the path of service account file. # GOOGLE_APPLICATION_CREDENTIALS is the path of service account file.
if [ -z "${GOOGLE_APPLICATION_CREDENTIALS:-""}" ]; then if [ -n "${GOOGLE_APPLICATION_CREDENTIALS:-}" ]; then
echo "GOOGLE_APPLICATION_CREDENTIALS is not set" gcloud auth activate-service-account --key-file "${GOOGLE_APPLICATION_CREDENTIALS}" --project="${PROJECT}"
exit 1
fi fi
# Activate gcloud service account.
gcloud auth activate-service-account --key-file "${GOOGLE_APPLICATION_CREDENTIALS}" --project="${PROJECT}"
cat /etc/os-release cat /etc/os-release
apt-get update apt-get update
apt-get install -y libseccomp2 libseccomp-dev apt-get install -y libseccomp2 libseccomp-dev