From 13b14736a8e518a3cd764fb99bb922f783a4362f Mon Sep 17 00:00:00 2001 From: Chao Dai Date: Wed, 17 Aug 2022 11:39:21 -0700 Subject: [PATCH] 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 --- test/build-utils.sh | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/test/build-utils.sh b/test/build-utils.sh index 408e0b771..2c8c102e0 100755 --- a/test/build-utils.sh +++ b/test/build-utils.sh @@ -18,14 +18,10 @@ : "${PROJECT:=k8s-cri-containerd}" # GOOGLE_APPLICATION_CREDENTIALS is the path of service account file. -if [ -z "${GOOGLE_APPLICATION_CREDENTIALS:-""}" ]; then - echo "GOOGLE_APPLICATION_CREDENTIALS is not set" - exit 1 +if [ -n "${GOOGLE_APPLICATION_CREDENTIALS:-}" ]; then + gcloud auth activate-service-account --key-file "${GOOGLE_APPLICATION_CREDENTIALS}" --project="${PROJECT}" fi -# Activate gcloud service account. -gcloud auth activate-service-account --key-file "${GOOGLE_APPLICATION_CREDENTIALS}" --project="${PROJECT}" - cat /etc/os-release apt-get update apt-get install -y libseccomp2 libseccomp-dev