Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Ignore empty annotations in the jq query #625

Merged
merged 1 commit into from
Jun 12, 2024

Conversation

DolceTriade
Copy link
Contributor

When building OCI images, we use a newline separated file in the form "a=b\nb=c\nd=e". However, if this file has a trailing newline, you get a pretty confusing error like "jq: error (at :37): Cannot use null (null) as object key" because jq splits that final newline into an empty string, and further tries to split it on the "=" which results in a null key.

Instead, filter out any empty strings.

When building OCI images, we use a newline separated file in the form
"a=b\nb=c\nd=e". However, if this file has a trailing newline, you get a
pretty confusing error like "jq: error (at <stdin>:37): Cannot use null
(null) as object key" because jq splits that final newline into an empty
string, and further tries to split it on the "=" which results in a null
key.

Instead, filter out any empty strings.
@thesayyn thesayyn merged commit 44175f4 into bazel-contrib:2.x Jun 12, 2024
14 checks passed
@DolceTriade DolceTriade deleted the trailingnewline branch June 12, 2024 18:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants