Skip to content

Commit 2df753f

Browse files
authored
Merge pull request #1966 from GoogleContainerTools/no_jq_error_empty
Make jq pass on empty result
2 parents b70878e + 8ed63f3 commit 2df753f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

private/tools/lifecycle/tag.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ function tag_update() {
3636
# jq behavior for all(test(pattern)) matches the empty list []
3737
# or are older than 2 days (we don't want to accidentally mess with any
3838
# ongoing builds)
39-
readarray -t targets < <(echo "$images_json" | jq -er --arg now "$NOW" '
39+
readarray -t targets < <(echo "$images_json" | jq -r --arg now "$NOW" '
4040
.manifest | to_entries | sort_by(.value.timeUploadedMs|tonumber) | .[] | select(
4141
(.value.tag // [] | all(test(".*-[a-f0-9]{40}$|^[a-f0-9]{40}$")))
4242
and
@@ -61,7 +61,7 @@ function tag_deprecate() {
6161

6262
# get all hashes for all images don't have the deprecated tag
6363
# this is only for wholesale deprecation of an image
64-
readarray -t targets < <(echo "$images_json" | jq -er '
64+
readarray -t targets < <(echo "$images_json" | jq -r '
6565
.manifest | to_entries | sort_by(.value.timeUploadedMs|tonumber) | .[] | select(
6666
.value.tag // [] | all(test("deprecated-public-image-[a-f0-9]{64}$") | not)
6767
) | .key

0 commit comments

Comments
 (0)