Skip to content

Commit 65f0552

Browse files
authored
fix: jq: error (at <stdin>:16): Cannot use null (null) as object key error on empty line in labels file (#606)
1 parent 333a982 commit 65f0552

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

oci/private/image.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ for ARG in "$@"; do
159159
CONFIG=$(jq --arg workdir "${ARG#--workdir=}" '.config.WorkingDir = $workdir' <<<"$CONFIG")
160160
;;
161161
--labels=*)
162-
CONFIG=$(jq --rawfile labels "${ARG#--labels=}" '.config.Labels += ($labels | split("\n") | map(. | split("=")) | map({key: .[0], value: .[1:] | join("=")}) | from_entries)' <<<"$CONFIG")
162+
CONFIG=$(jq --rawfile labels "${ARG#--labels=}" '.config.Labels += ($labels | split("\n") | map(select(. | length > 0)) | map(. | split("=")) | map({key: .[0], value: .[1:] | join("=")}) | from_entries)' <<<"$CONFIG")
163163
;;
164164
--annotations=*)
165165
get_manifest |

0 commit comments

Comments
 (0)