-
Notifications
You must be signed in to change notification settings - Fork 226
Initial PR to propose updates to tag listing #579
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
3b61226
to
c50655b
Compare
"mediaType": "application/vnd.oci.image.manifest.v1+json", | ||
"size": 1234, | ||
"digest": "sha256:a2a2a2...", | ||
"annotations": { |
There was a problem hiding this comment.
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
Signed-off-by: Jeff Carter <[email protected]>
c50655b
to
8d87d35
Compare
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` |
There was a problem hiding this comment.
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>" |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
"org.opencontainers.image.ref.created": "2022-01-01T14:42:55Z", | ||
"org.opencontainers.image.ref.name": "<tag1>" |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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 🤔
There was a problem hiding this comment.
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).
There was a problem hiding this 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` |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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: |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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: |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
Motivation:
Provide registry agnostic mechanism to get new tags
Related to discussions at: