Skip to content

Conversation

jcarter3
Copy link

@jcarter3 jcarter3 commented Jun 26, 2025

Motivation:
Provide registry agnostic mechanism to get new tags

Related to discussions at:

@jcarter3 jcarter3 force-pushed the update_tag_listing branch 4 times, most recently from 3b61226 to c50655b Compare June 26, 2025 16:37
@jcarter3 jcarter3 marked this pull request as ready for review June 26, 2025 16:40
"mediaType": "application/vnd.oci.image.manifest.v1+json",
"size": 1234,
"digest": "sha256:a2a2a2...",
"annotations": {
Copy link
Author

Choose a reason for hiding this comment

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

Note: This will not contain all annotations specified on the manifest

@jcarter3 jcarter3 force-pushed the update_tag_listing branch from c50655b to 8d87d35 Compare June 26, 2025 19:00
Registries MAY support an enhanced tag listing experience when clients pass an `Accept` header value of
`application/vnd.oci.image.index.v1+json`. If a registry supports this mode, they MUST support these additional query parameters:
* `sort_by` - allowed values are `created_at`, `name`
* `sort_order` - allowed values are `asc` and `desc`
Copy link
Author

Choose a reason for hiding this comment

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

A future update can include some sort of filter option, but has been left out for now.

"digest": "sha256:a1a1a1...",
"annotations": {
"org.opencontainers.image.ref.created": "2022-01-01T14:42:55Z",
"org.opencontainers.image.ref.name": "<tag1>"
Copy link

@qweeah qweeah Jun 27, 2025

Choose a reason for hiding this comment

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

If a manifest has more than one tags attached, would it be more efficient to merge all the tags into one entry here?

Copy link
Author

Choose a reason for hiding this comment

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

It'd be more efficient, yes. But then it makes it harder to pass back a separate created timestamp for each, plus it'd mess up the ordering. If this was a manifest list, it'd make sense to merge the tags, but for a tag listing, it's easier to keep them separate

Comment on lines +578 to +579
"org.opencontainers.image.ref.created": "2022-01-01T14:42:55Z",
"org.opencontainers.image.ref.name": "<tag1>"

Choose a reason for hiding this comment

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

Do these annotations originate from the original manifest data, or are they generated by the registry and added to the descriptors? 🤔

  • If they come from the manifest data, how does the API handle manifests that do not contain these annotations?
  • If they are generated by the registry, how does the API manage potential conflicts between the manifest annotation values and the registry-recorded values, such as creation time?

Copy link
Author

Choose a reason for hiding this comment

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

They are generated by the registry. The registry may optionally include other annotations, including those from the manifest if it chooses.

For conflicts, there shoudn't be any. The ...image.ref.* tags are specific to a reference, not to a manifest - As in, a manifest shouldn't include an annotation of the reference it will be tagged with after it's pushed. Though maybe there is some weird edge case where this happens 🤔

Copy link
Member

Choose a reason for hiding this comment

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

But also, relevant to #579 (comment), if a registry chooses to "pull up" annotations from the manifest, it should do so before setting those specified by this API, because they're defined to have a particular meaning in this context (so "pulling up" the annotations from the manifest will be limiting to future changes of this API).

Copy link
Contributor

@sudo-bmitch sudo-bmitch left a comment

Choose a reason for hiding this comment

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

We need to add conformance tests, and get some example implementations.

Edit to add: if we add more sort orders or filters in the future, how would the client know if they were applied or if the registry only supports the first iteration of these features?

@@ -559,10 +559,52 @@ The tags MUST be in lexical order.

When using the `last` query parameter, the `n` parameter is OPTIONAL.

Registries MAY support an enhanced tag listing experience when clients pass an `Accept` header value of
`application/vnd.oci.image.index.v1+json`. If a registry supports this mode, they MUST support these additional query parameters:
* `sort_by` - allowed values are `created_at`, `name`
Copy link
Contributor

Choose a reason for hiding this comment

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

Linting nit, add white space line between bulleted list and the preceding paragraph.

* `sort_order` - allowed values are `asc` and `desc`

The response MUST be a json body in the following format:
```json
Copy link
Contributor

Choose a reason for hiding this comment

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

Linting nit, add whitespace line between code block and paragraph.

]
}
```
The following annotations MUST be included:
Copy link
Contributor

Choose a reason for hiding this comment

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

Linting nit, add whitespace line here too for the code block.

Co-authored-by: Brandon Mitchell <[email protected]>
Co-authored-by: Tianon Gravi <[email protected]>
Signed-off-by: Jeff <[email protected]>
}
```
The following annotations MUST be included:
* `org.opencontainers.image.ref.created` - Date and time the reference was created (date-time string as defined by RFC 3339). If unknown, default to epoch.
Copy link
Contributor

Choose a reason for hiding this comment

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

A resource usually has two timestamps: one for creation and another for modification. For example, tag v1 is created on 2022-01-01T07:21:33Z and later re-tagged on 2022-02-03T08:21:21Z. Do you want to introduce a new annotation for the modification / update time?

Copy link
Author

Choose a reason for hiding this comment

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

I'd say this could be an optional value added by registries, but we can specify an annotation for it. Some registries may not have this information, and it might be of little value (it wouldn't give a history) on it's own.

* `sort_by` - allowed values are `created_at`, `name`
* `sort_order` - allowed values are `asc` and `desc`

The response MUST be a json body in the following format:
Copy link
Contributor

Choose a reason for hiding this comment

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

Just a note: This example response looks like an index.json in the OCI image layout, which serves as a tag list or generally a manifest list.

Copy link
Member

Choose a reason for hiding this comment

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

That's entirely intentional, and even why it's reusing the annotation that's "only for index.json" 😅

Reusing the "image index" structure for this also matches the design of the referrers API, which is a useful pattern because it avoids defining "yet another data schema" without a really strong reason.

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.

6 participants