-
Notifications
You must be signed in to change notification settings - Fork 229
Description
Many tools exist these days to help users to upgrade their dependencies. A non-exhaustive list includes:
There is no existing API in the distribution spec to check for "new" tags (or manifests) - so if clients want a registry agnostic solution, they need to list all tags and try to find an update by using semvar rules. Since semvar is not universal, this is not an amazing experience. Additionally, this tag listing doesn't indicate if a tag has moved to a different digest, requiring a separate HEAD request to check that.
Because of this, several clients have also implemented registry specific API calls which do allow for querying tags by last updated. These APIs are not always well suited for this task though, and provide far more information and is actually necessary for this update check.
I'd like to start some discussion around ways we can make this easier for both the clients (more efficient checks, universally supported) and registries (lower burden from scrapers). It can also be used to make it easier to mirror repositories across multiple registries. A few initial ideas:
Option 1 - New update endpoint, in the style of catalog (not repo scoped):
/v2/updates?repository=foo/bar&repository=foo/baz&since=<time>
This would return a list of json objects in a format like:
{
"repository": "foo/bar",
"digest": <digest>,
"tag": <tag>, // if present
"mediaType: <you_get_the_idea>,
"timestamp": ...
}
Pro: A single endpoint to get updates to N repositories, though the response would then need sorted out.
Con: Stateless clients may not know a since value to add, which could require it to default to the last N updates per repo, or some default time value.
Option 2 - Improved tag/manifest listing
There are some existing proposals/discussions to improve the tag/manifest listing endpoints to provide more usable data. If we could list tags/manifests using a sort, and the response data coming back included more metadata (timestamps, digests, mediatypes, etc), it could solve this need.
Pro: A more generic solution solving multiple needs
Pro: More options on checking for updates - Updates in , updates pushed since some digest, etc
Con: Need to check each repository individually.
At Docker, we'd like to start pushing hard on this and moving quickly on some implementation and start getting clients to move over, but want input on a preferred direction from other clients and distribution maintainers.