Skip to content

Conversation

cgwalters
Copy link
Collaborator

Motivated by ostreedev/ostree#3523

This is an obvious and trivially easy thing to do here, and makes dereferencing from "merge -> base" client side also trivial which is especially important in the initramfs.

@bootc-bot bootc-bot bot requested a review from jeckersb September 9, 2025 16:27
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request correctly sets the parent of a merged container image commit to its base ostree commit, which simplifies client-side logic. The implementation is straightforward and the accompanying tests are thorough, verifying both the parent-child relationship and the presence of the original commit hash as a label in the new image. The changes are high quality and I have no further suggestions.

Motivated by ostreedev/ostree#3523

This is an obvious and trivially easy thing to do here, and
makes dereferencing from "merge -> base" client side also
trivial which is especially important in the initramfs.

Signed-off-by: Colin Walters <walters@verbum.org>
@cgwalters cgwalters added the area/ostree Issues related to ostree label Sep 9, 2025
@alexlarsson
Copy link
Contributor

I like this. It is useful, but it also fundamentally true. The real commit is the parent.

@cgwalters cgwalters enabled auto-merge September 9, 2025 19:58
@cgwalters cgwalters merged commit a67bac2 into bootc-dev:main Sep 10, 2025
28 checks passed
alexlarsson added a commit to alexlarsson/ostree that referenced this pull request Sep 15, 2025
When using bootc, if you convert a signed ostree commit into an OCI
image `rpm-ostree compose container-encapsulate` you end up with a new
commit that isn't signed. However, the base commit object, and its
commitmeta are still in the image and will end up the repo, and
since bootc-dev/bootc#1600 the base commit
id is available as the parent commit.

So, we change ostree-prepare-root to fall back to using the base
commit+commitmeta to find the expected composefs digest if the main
commit is not signed.

Note: This will only work with ostree-only commits. If you have any
layered data, then the content will change, and the composefs digest
in the base commit will not match the deployed one. This is expected
with such sealed commits though. If you want to layer, either disable
sealing, or create a new sealed ostree commit for the new image.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/ostree Issues related to ostree
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants