mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-21 19:01:49 +00:00
Merge pull request #105920 from SergeyKanzhelev/fixReturnValueHandling
return value is taken from if statement instead of the function call
This commit is contained in:
commit
37efc5feec
@ -187,7 +187,7 @@ function download-or-bust {
|
|||||||
|
|
||||||
echo "Getting the scope of service account configured for VM."
|
echo "Getting the scope of service account configured for VM."
|
||||||
if ! valid-storage-scope ; then
|
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
|
# 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
|
# 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."
|
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
|
if access_token=$(get-credentials); then
|
||||||
echo "Service account access token is received. Downloading ${url} using this token."
|
echo "Service account access token is received. Downloading ${url} using this token."
|
||||||
else
|
else
|
||||||
local exit_code=$?
|
|
||||||
echo "Cannot get a service account token. Exiting."
|
echo "Cannot get a service account token. Exiting."
|
||||||
exit ${exit_code}
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
curl_headers=${access_token:+Authorization: Bearer "${access_token}"}
|
curl_headers=${access_token:+Authorization: Bearer "${access_token}"}
|
||||||
|
Loading…
Reference in New Issue
Block a user