You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 12, 2018. It is now read-only.
This landed in 82021b4 (Merging bypass-tarsum, 2014-04-07, #300), but
those Dockers are now ancient history.
I'm against this sort of user-agent-dependent behavior in general. If
we want to version the API, it makes sense to have version checks in
one place (e.g. in the URL, or in an explicit Docker-Version header,
or in the PUT payload, ...). I'm happy with either the URL approach
(always explicit) or the Docker-Version approach (defaulting to the
current version). If we make some small change to the API (such as not
storing layer tarsums), and want to add per-feature headers or
registry-side options to enable/disable this behaviour, that's
fine. If we can auto-detect new features (e.g. if
Docker-Checksum-Payload exists, it must be using the new SHA-256
semantics), that's fine too. But regardless of how we version the API,
conflating the API version with the user-agent version just seems
confusing.
Olivier wants us to warn older clients instead of just failing when
their tarsum doesn't match our checksum [1], so we still need to use
their user-agent string to decide which clients get warned. I've
softened the old DockerVersion into a more relaxed
docker_client_version, which no longer rejects non-Docker clients [2].
If we can't version the API, we can at least use a blacklist to deny
old implementations instead of a whitelist that requires other clients
to fake the Docker-daemon User-Agent string.
For the 'PUT /v1/images/<image_id>/checksum' endpoint, we don't need
to rely on the user-agent, because the old X-Docker-Checksum was
replaced by the new X-Docker-Checksum-Payload. If the client isn't
setting X-Docker-Checksum-Payload, just say that in the error message
and hint that it might be due to an outdated client.
I'd like to remove all the user-agent-dependent behavior, but we're
currently also using it to setup some tag metadata in
docker_registry.tags.put_tag. I don't touch that here, since I
haven't tracked down the reasoning behind that behavior (although I
suspect it's also a bad idea ;).
I also haven't touched the user-agent bits under tests/, since I
haven't checked to see if they're designed to test this check, or to
test the put_tags check, or just to bypass either of those checks.
[1]: #570 (comment)
[2]: #375
0 commit comments