Skip to content

Rename cagent OCI annotation, keep old one#1745

Merged
dgageot merged 1 commit intodocker:mainfrom
gtardif:oci_annotations_renaming
Feb 16, 2026
Merged

Rename cagent OCI annotation, keep old one#1745
dgageot merged 1 commit intodocker:mainfrom
gtardif:oci_annotations_renaming

Conversation

@gtardif
Copy link
Collaborator

@gtardif gtardif commented Feb 16, 2026

Support annotation io.docker.agent.version in addition to the cagent one
Updated config media type with docker.agent

@gtardif gtardif requested a review from a team as a code owner February 16, 2026 09:24
Copy link

@docker-agent docker-agent bot left a comment

Choose a reason for hiding this comment

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

Review Summary

Approved - No functional bugs found in the changed code.

This PR successfully implements the OCI annotation renaming from io.docker.cagent.version to io.docker.agent.version while maintaining backward compatibility. The changes were analyzed for potential bugs:

Changes Reviewed:

  1. pkg/oci/package.go: Added new annotation io.docker.agent.version alongside the old one, and updated config media type
  2. pkg/remote/pull.go: Modified hasCagentAnnotation() to check new annotation first, then fall back to old annotation

Analysis:

  • Backward Compatibility: ✅ Old artifacts with only io.docker.cagent.version will still be recognized through the fallback logic in hasCagentAnnotation()
  • Forward Compatibility: ✅ New artifacts include both annotations, so older clients can still read them
  • Media Type Change: ✅ No impact on compatibility - the codebase doesn't validate config media types anywhere; only annotations are checked
  • Annotation Validation: ✅ Properly handles both old and new annotation formats with appropriate fallback

The implementation correctly maintains compatibility in both directions.

@gtardif gtardif force-pushed the oci_annotations_renaming branch from 2b80fcd to ceecf4b Compare February 16, 2026 09:27
@gtardif
Copy link
Collaborator Author

gtardif commented Feb 16, 2026

Just rebased as the branch was a bit behind main

Signed-off-by: Guillaume Tardif <guillaume.tardif@gmail.com>
@gtardif gtardif force-pushed the oci_annotations_renaming branch from ceecf4b to d0d4a21 Compare February 16, 2026 11:46
@dgageot dgageot merged commit b5a9ba1 into docker:main Feb 16, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants