Skip to content

fix: distinguish OCI manifest annotations from config labels - #2570

Merged
jeckersb merged 1 commit into
bootc-dev:mainfrom
mvanhorn:fix/2227-oci-labels-annotations
Oct 27, 2026
Merged

jeckersb merged 1 commit into
bootc-dev:mainfrom
mvanhorn:fix/2227-oci-labels-annotations

Conversation

@mvanhorn

Copy link
Copy Markdown
Contributor

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-container locally 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.

@github-actions github-actions Bot added the area/ostree Issues related to ostree label Oct 15, 2026
@bootc-bot
bootc-bot Bot requested a review from jeckersb October 15, 2026 12:35
@cgwalters
cgwalters requested a balanced review from Copilot October 16, 2026 17:32

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔵 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.

@Johan-Liebert1

Copy link
Copy Markdown
Member

@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>
@mvanhorn
mvanhorn force-pushed the fix/2227-oci-labels-annotations branch from eb723a0 to 4122418 Compare October 27, 2026 16:38
@mvanhorn

Copy link
Copy Markdown
Contributor Author

@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.

@jeckersb
jeckersb enabled auto-merge (rebase) October 27, 2026 20:37
@jeckersb
jeckersb merged commit d3b33bc into bootc-dev:main Oct 27, 2026
54 checks passed
@cgwalters

Copy link
Copy Markdown
Collaborator

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 /rebase slash command I tried this but it got reverted in bootc-dev/infra#138

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.

Conflation between OCI labels and annotations

5 participants