From c703725592aa27bcf36213a72e45a53fe130bf35 Mon Sep 17 00:00:00 2001 From: Sergey Kanzhelev Date: Tue, 26 Oct 2021 00:11:55 +0000 Subject: [PATCH] return value is taken from if statement instead of the function call --- cluster/gce/gci/configure.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/cluster/gce/gci/configure.sh b/cluster/gce/gci/configure.sh index f4635628eea..56417c67d0a 100644 --- a/cluster/gce/gci/configure.sh +++ b/cluster/gce/gci/configure.sh @@ -187,7 +187,7 @@ function download-or-bust { echo "Getting the scope of service account configured for VM." if ! valid-storage-scope ; then - canUseCredentials=$? + canUseCredentials=1 # this behavior is preserved for backward compatibility. We want to fail fast if SA is not available # and try to download without SA if scope does not exist on SA echo "No service account or service account without storage scope. Attempt to download without service account token." @@ -199,9 +199,8 @@ function download-or-bust { if access_token=$(get-credentials); then echo "Service account access token is received. Downloading ${url} using this token." else - local exit_code=$? echo "Cannot get a service account token. Exiting." - exit ${exit_code} + exit 1 fi curl_headers=${access_token:+Authorization: Bearer "${access_token}"}