daemon/containerd: pass custom metaHeaders to resolver#51024
Merged
vvoland merged 1 commit intomoby:masterfrom Sep 25, 2025
Merged
daemon/containerd: pass custom metaHeaders to resolver#51024vvoland merged 1 commit intomoby:masterfrom
vvoland merged 1 commit intomoby:masterfrom
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
thaJeztah
commented
Sep 23, 2025
Similar to how [distribution.newRepository] in the legacy distribution code passes the (custom) http-headers. User-Agent is always set, and can't be overridden, so we apply it after setting the custom headers. [distribution.newRepository]: https://github.com/moby/moby/blob/9ce272f804a9383c9aa593527d318c946bfb7b38/daemon/internal/distribution/registry.go#L74-L97 Before this patch: docker run --rm -d --name debugger -p 127.0.0.1:5001:8080 mendhak/http-https-echo DOCKER_CUSTOM_HEADERS=X-Meta-Hello=thaJeztah docker pull localhost:5001/myimage:latest docker logs debugger ... "headers": { "host": "localhost:5001", "user-agent": "docker/dev go/go1.24.7 git-commit/8e89fe7e8cbb3048f640846590175cbae4719b25 kernel/6.10.14-linuxkit os/linux arch/arm64 containerd-client/2.1.4+unknown storage-driver/overlayfs UpstreamClient(Docker-Client/28.3.2 \\(linux\\))", "accept": "application/json, */*", "accept-encoding": "zstd;q=1.0, gzip;q=0.8, deflate;q=0.5", "baggage": "trigger=api" }, With this patch: docker run --rm -d --name debugger -p 127.0.0.1:5001:8080 mendhak/http-https-echo DOCKER_CUSTOM_HEADERS=X-Meta-Hello=thaJeztah docker pull localhost:5001/myimage:latest docker logs debugger ... "headers": { "host": "localhost:5001", "user-agent": "docker/dev go/go1.24.7 git-commit/8e89fe7e8cbb3048f640846590175cbae4719b25 kernel/6.10.14-linuxkit os/linux arch/arm64 containerd-client/2.1.4+unknown storage-driver/overlayfs UpstreamClient(Docker-Client/28.3.2 \\(linux\\))", "accept": "application/json, */*", "accept-encoding": "zstd;q=1.0, gzip;q=0.8, deflate;q=0.5", "baggage": "trigger=api", "x-meta-hello": "thaJeztah" }, Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
eba2dd4 to
a32a53a
Compare
Member
Author
Panic fixed, but looks like that means that |
vvoland
approved these changes
Sep 25, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Similar to how distribution.newRepository in the legacy distribution code passes the (custom) http-headers. User-Agent is always set, and can't be overridden, so we apply it after setting the custom headers.
Before this patch:
With this patch:
- What I did
- How I did it
- How to verify it
- Human readable description for the release notes
- A picture of a cute animal (not mandatory but encouraged)