fix(proxy): fix tag list endpoint in proxy mode#4846
Conversation
4c97a1d to
7f21aaf
Compare
Signed-off-by: njucjc <njucjc@alibaba-inc.com> Signed-off-by: chenjinci.cjc <chenjinci.cjc@alibaba-inc.com>
7f21aaf to
60de6e3
Compare
|
can this please approved and released? otherwise i need to stay on the vulnerable v3.0.0 😕 |
|
You can always pull |
|
I'm not sure this is fixed... I am running the EDIT: also verified by pulling with explicit digest for the latest |
Could you show your configuration file? |
|
I deploy through a compose stack with everything configured through ENVs: dockerio-distribution-mirror:
image: distribution/distribution:edge@sha256:052c944bf4e611dd6fa311e6c2ba52665fcd8299b955dff05adbf4508f4c29fa
volumes:
- $DOCKER_DATA/distribution-proxy/registries/dockerio:/var/lib/registry
environment:
REGISTRY_PROXY_REMOTEURL: https://registry-1.docker.io
REGISTRY_PROXY_USERNAME: foxxmd
REGISTRY_PROXY_PASSWORD: ${DOCKERHUB_PASSWORD}
REGISTRY_PROXY_TTL: 12h
REGISTRY_REDIS_ADDRS: "[distribution-valkey:6379]"
REGISTRY_STORAGE_DELETE_ENABLED: true
REGISTRY_STORAGE_CACHE_BLOBDESCRIPTOR: redis |
|
@FoxxMD, yeah, that won't work at the moment, see this code: distribution/registry/handlers/tags.go Lines 45 to 53 in e39652c if you want that call to NOT return 400, you need to override
I need to think about how to make this spec conformant before I open a patch |
PR distribution#4353 made MaxTags (default 1000) a hard ceiling on the `n` query parameter — anything larger and the handler returns 400 PAGINATION_NUMBER_INVALID before the request ever reaches storage or the proxy tag service. That broke clients like Renovate which use n=10000 against pull-through caches. distribution#4846 fixed a related 500 in proxy mode but not this 400, so users reported the regression still persisted. The OCI distribution-spec describes pagination differently: a server MAY return fewer than `n` results "when the total number of tags attached to the repository is less than <int> or a Link header is provided" — otherwise it MUST include `<int>` results. In other words, the right answer for "client asked for more than we'll serve" is `maxtags` results plus a Link header, not a rejection. PAGINATION_NUMBER_INVALID isn't among the 14 error codes the spec defines, either. Drop the oversized-n rejection and clamp to MaxTags instead; the existing Link-header path already handles continuation correctly. Malformed (non-integer) and negative `n` values keep returning 400, since the spec defines `n` as a non-negative integer and those requests are genuinely invalid. Verified end-to-end against registry-1.docker.io in proxy mode: n=10000 now returns the tag list (or a clamped page with Link) instead of 400. Also restores pre-3.1.0 behavior for Renovate-style clients without needing proxy-specific logic. Spec reference: https://github.com/opencontainers/distribution-spec/blob/main/spec.md#listing-tags Signed-off-by: Milos Gajdos <milosthegajdos@gmail.com>
|
Maybe this #4856 |
|
Thank you for the correction on the missing |
Fix #4844