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: accumulate image manifests in oci_image_index #633

Merged

Conversation

seh
Copy link
Contributor

@seh seh commented Jun 20, 2024

In the recent #386, when we replaced use of the yq tool with the jq tool, we translated the oci_image_index rule's accumulation of image manifests incorrectly, such that we lose all but the last index that we add to the index.

In jq, the update-assignment operator (|=) does not append to an array supplied as its left-hand context value automatically. Instead, one must use a complex assignment, mentioning the context value explicitly together with the addition operator.

See the preceding discussion in the "docker" channel of the "Bazel" Slack workspace a chronicle of discovering this defect.

Fixes #638.

@thesayyn
Copy link
Collaborator

would be nice to have a test for this.

@seh seh force-pushed the correct-oci-image-index-manifest-collection branch from b757fb3 to d96429a Compare June 20, 2024 18:25
@seh
Copy link
Contributor Author

seh commented Jun 20, 2024

would be nice to have a test for this.

It turns out that we did, sort of, in the sense that it sets up the right scenario. It was confirming the message digest of the index—one that had contained the wrong set of manifests—but it does not yet check, say, the number of manifests present in the index.

@seh
Copy link
Contributor Author

seh commented Jun 21, 2024

It appears that the lone CI workflow failure was due to a flaky server. I lack permission to run the workflow again. Can one of the maintainers please trigger that workflow to run again?

@seh seh mentioned this pull request Jun 24, 2024
oci/private/image_index.sh.tpl Outdated Show resolved Hide resolved
In the recent bazel-contrib#386, when we replaced use of the "yq" tool with the
"jq" tool, we translated the "oci_image_index" rule's accumulation of
image manifests incorrectly, such that we lose all but the last index
that we add to the index.

In "jq", the "update-assignment" operator (|=) does not append to an
array supplied as its left-hand context value automatically. Instead,
one must use a "complex assignment", mentioning the context value
explicitly together with the addition operator.
@seh seh force-pushed the correct-oci-image-index-manifest-collection branch from d96429a to c3ff469 Compare June 25, 2024 12:42
@thesayyn thesayyn merged commit 96062d4 into bazel-contrib:2.x Jun 26, 2024
14 checks passed
@seh seh deleted the correct-oci-image-index-manifest-collection branch June 26, 2024 11:48
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