fix(ocireg): preserve default transport settings for HTTPS registries#1888
Closed
mabo235 wants to merge 1 commit into
Closed
fix(ocireg): preserve default transport settings for HTTPS registries#1888mabo235 wants to merge 1 commit into
mabo235 wants to merge 1 commit into
Conversation
Signed-off-by: Marc Born <mail@marcborn.de>
8957607 to
9715c5a
Compare
Contributor
Author
|
@piotrjanik I checked this again against #1887, and it looks like the underlying ocireg HTTPS transport issue is covered there now. #1887 centralizes transport creation via a cloned http.DefaultTransport and the ocireg resolver uses that path as well, so I’m happy to close this one as superseded. |
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.
Summary
This changes the HTTPS transport setup in
api/oci/extensions/repositories/ociregto clone
http.DefaultTransportbefore applying the custom TLS configuration.The previous implementation created a bare
http.Transportwith onlyTLSClientConfigset. That dropped default transport behavior and causedresolver failures against some public registries.
Root cause
The
ociregresolver currently replaces the HTTP transport with a new customtransport that only sets
TLSClientConfig.That loses default transport settings which are preserved by
http.DefaultTransport.(*http.Transport).Clone().In practice this showed up as intermittent Docker Hub auth failures during
artifact resolution, for example:
GET https://auth.docker.io/token?...403 ForbiddenA minimal resolver repro failed with the old transport and succeeded when using
a cloned default transport with the same TLS configuration.
Changes
newHTTPTransport(conf *tls.Config) *http.Transporttransport and keeps its default settings while replacing
TLSClientConfigValidation
Tested with:
go test ./api/oci/extensions/repositories/ocireg -count=1Additionally verified against a real resolver and fetch path on Linux where the
old behavior failed on public Docker Hub artifacts and the patched resolver
successfully resolved them.