Repository navigation
Description
This came up in a chat.
We use the OCI annotation keys org.opencontainers.image.created and org.opencontainers.image.version, however at a glance it looks like we're inconsistent on whether we use those keys when looking at actual annotations, or rather looking at the labels on the container. Those are not the same thing. Quick AI-assisted dump of some places this comes up:
Instances of annotation constants used to query labels
| File | Line | Constant | Queried from |
|---|---|---|---|
crates/lib/src/status.rs |
205 | ANNOTATION_CREATED |
config labels |
crates/lib/src/install/aleph.rs |
55 | ANNOTATION_CREATED |
config labels |
crates/ostree-ext/src/container/mod.rs |
490 | ANNOTATION_VERSION |
config labels |
Correct usages (for comparison)
| File | Line | Constant | Queried from |
|---|---|---|---|
crates/ostree-ext/src/container/store.rs |
597 | ANNOTATION_CREATED |
manifest annotations |
crates/lib/src/bootc_composefs/status.rs |
514 | ANNOTATION_VERSION |
manifest annotations |
Additional observations
-
ANNOTATION_VERSIONis less problematic in practice because the write-side incrates/ostree-ext/src/container/encapsulate.rs:265-318intentionally writes the version to both config labels and manifest annotations. And for non-ostree-ext-built images, Dockerfiles typically useLABEL org.opencontainers.image.version=..., so it ends up in labels anyway. -
ANNOTATION_CREATEDis the more problematic one. The encapsulate code does not write it into labels — it only setsconfig.set_created(). So the label lookup atstatus.rs:205andaleph.rs:55will almost never match; they're saved by the fallback toconfig.created(). -
There's an inconsistency between the ostree and composefs code paths. The composefs status code (
bootc_composefs/status.rs:514) correctly readsANNOTATION_VERSIONfrom manifest annotations, while the ostree status code (status.rs:211viaversion_for_config) reads it from config labels. These could diverge for images where the value is only in one location.
Activity
bootc/build: image version also as a manifest annotation (bootc's com…
vonbloom commentedon Oct 8, 2026
A user-visible consequence of this, on the composefs backend:
bootc statusshows no version ("version": null) for images built with a ContainerfileLABEL org.opencontainers.image.version=...(orpodman build --label), the usual way to set it, while the same image shows its version on the ostree backend.The composefs status reads only the manifest annotation
bootc/crates/lib/src/bootc_composefs/status.rs
Lines 631 to 635 in d01e723
the ostree one only the config labels (
version_for_config). Images written by ostree-ext's encapsulate have both, which is probably why this went unnoticed; Containerfile builds (and rechunkers that copy the config, e.g. chunkah) only have the label.Could the composefs status fall back to
version_for_config()when the annotation is missing?Seen with bootc 1.17.0 and 1.17.1.
mvanhorn commentedon Oct 15, 2026
Composefs deployment metadata read org.opencontainers.image.version only from the manifest annotation map. A Containerfile LABEL and podman build --label write that key into the image configuration labels, which is a separate map.
Composefs status now resolves the version in image_version_and_created: the manifest annotation is kept when present, and otherwise version_for_config supplies the OCI version label and then the legacy version label.
#2570
fix: distinguish OCI manifest annotations from config labels
fix: distinguish OCI manifest annotations from config labels
status: Read the image creation time from the manifest