Repository navigation
fix: distinguish OCI manifest annotations from config labels - #2570
Conversation
There was a problem hiding this comment.
🔵 Needs a closer look
No blocking defects were identified, but successful test validation and required human review remain outstanding.
0 open findings
What changed in this PR
Fixes composefs status reporting a null version for images whose version is stored in configuration labels.
Changes:
- Preserves manifest annotation precedence, then falls back to OCI and legacy version labels.
- Adds a dedicated OCI version label constant and tests for version precedence and timestamp handling.
| File | Description |
|---|---|
crates/ostree-ext/src/container/mod.rs |
Clarifies configuration label lookup and tests label precedence. |
crates/lib/src/bootc_composefs/status.rs |
Adds version fallback while preserving timestamp behavior, with regression tests. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
@mvanhorn could you please rebase on main and force push to fix CI failures? |
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. The created timestamp is still parsed from the configuration created field, and an unparseable value yields none. version_for_config looks up the new LABEL_OCI_VERSION constant, whose string is the manifest annotation key, and the added tests cover annotation precedence, both label forms, a missing version, an invalid created value, and created-key decoys in the annotation and label maps. Fixes bootc-dev#2227 Assisted-by: AI Signed-off-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com>
eb723a0 to
4122418
Compare
|
@Johan-Liebert1 rebased on main and force-pushed as 4122418. It applied cleanly and the change is the same. bootc does not build on my Mac, so CI is the check here, and I will watch it. |
|
We shouldn't make PR submitters deal with "ci rebases" in general (modulo signed commits, which would be super nice to handle) we should just have a |
Background
On the composefs backend, bootc status reports a null version for an image whose version was set with a Containerfile LABEL or with podman build --label. The ostree backend reports the version for that same image.
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. Ostree status already reads those labels, so the two backends disagree when the annotation was never set.
Summary of the fix
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. The created timestamp is still parsed from the configuration created field, and an unparseable value yields none. version_for_config looks up the new LABEL_OCI_VERSION constant, whose string is the manifest annotation key, and the added tests cover annotation precedence, both label forms, a missing version, an invalid created value, and created-key decoys in the annotation and label maps.
Testing
Ran
just test-containerlocally on macOS for the bootc get_imginfo change; it fails the same way on the base branch, so the failure predates this change (it fails the same way on upstream/main).Closes #2227
AI was used for assistance.