Skip to content

Commit e4d2ea4

Browse files
authored
use return statement instead of exit in is_public_ecr_logged_in (#197)
Description of changes: * use return statement instead of exit in `is_public_ecr_logged_in` function * tested locally that `kind-test` passes and builds docker image * By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
1 parent d361341 commit e4d2ea4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

scripts/lib/common.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,12 +131,12 @@ is_public_ecr_logged_in() {
131131
local expiration_time=$(jq -r --arg url $public_ecr_url '.auths[$url].auth' ~/.docker/config.json | base64 -d | cut -d":" -f2 | base64 -d | jq -r ".expiration")
132132

133133
# If any part of this doesn't exist, the user isn't logged in
134-
[ -z "$expiration_time" ] && exit 1
134+
[ -z "$expiration_time" ] && return 1
135135

136136
local current_time=$(date +%s)
137137

138138
# If the credentials have expired, the user isn't logged in
139-
[ "$expiration_time" -lt "$current_time" ] && exit 1
139+
[ "$expiration_time" -lt "$current_time" ] && return 1
140140

141-
exit 0
141+
return 0
142142
}

0 commit comments

Comments
 (0)