ostree: Set parent of merge commit to base commit if present#1600
Merged
cgwalters merged 1 commit intobootc-dev:mainfrom Sep 10, 2025
Merged
ostree: Set parent of merge commit to base commit if present#1600cgwalters merged 1 commit intobootc-dev:mainfrom
cgwalters merged 1 commit intobootc-dev:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
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>
0616425 to
4a11ee8
Compare
Contributor
|
I like this. It is useful, but it also fundamentally true. The real commit is the parent. |
alexlarsson
approved these changes
Sep 9, 2025
jeckersb
approved these changes
Sep 10, 2025
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.