This repository has been archived by the owner on Nov 7, 2024. It is now read-only.
container: Rework API and model around "base commit" and "merge commit" #147
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.
containers: Expose a state struct with base commit and layering state
This is actually quite analogous to what rpm-ostree does internally;
a lot of the internals there distinguish "base" versus "layered"
commits, and this is very similar.
Here, when we import a non-layered image, we can mostly
ignore the merge commit since all it has is the image manifest.
The base image layer ref is the encapsulated ostree commit with
all the metadata injected by (rpm-)ostree in the non-layered case.
Add an API which exposes this as a struct, and also return it
from the importer's
AlreadyPresent
case.container: Change import result case to contain state struct
Notably, this also stops exposing the ostree ref for the merge commit,
which I think is a good idea in general since it should be thought
of more as an implementation detail.
In other words, this module speaks container image references
and ostree commits.
container/deploy: Use base commit if we're not layered
If we're not doing a layered image, then use the base commit
for the deployment.
Closes: #143
container/deploy: Also write ref with target if provided
With this new emphasis on "dual commit objects" for the container
deployment, the higher level code queries via container image references
and we don't expose the ostree ref (since there is no longer a single
one).
This makes it critical to write the internal ref matching the
target container image, because it now needs to match the origin.