-
Notifications
You must be signed in to change notification settings - Fork 542
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New insecure flag handling (PR #1002) breaks http->https redirecting #1047
Comments
Going over both personal issues previously with the insecure behaviour as well as some open as well as old closed issues, from my perspective it would probably be best to revert the change and if it should change, to make it work in the same way as docker's insecure flag. See also #451 , #738 (#738 (comment)), #991 and #1024 |
Yeah this was something I was worried about with that change, going to revert it and see how we can fix things. We're doing some fundamentally weird stuff where this http fallback is backwards. The outer http.Client handles redirects, but the inner http.RoundTripper is the one selecting the scheme, which doesn't handle redirects (I should have considered this). This scheme logic should live at a higher layer than it does.
I haven't looked at exactly how this works in a while, I'd be interested in more details. |
From what I know it hasn't changed since #738 (comment) but I can look it up. It indeed hasn't; https://docs.docker.com/registry/insecure/
|
We should probably have a test to catch any regressions here. |
We have a generalized/automated deployment workflow that utilizes crane to transfer images to registries, both secure and insecure. Because the registries can be of either type, we have the insecure flag set per default.
Starting with commit 9e56ddd / PR #1002 , which changes how the insecure flag is handled/interpreted, these have now started failing for registries that redirect HTTP to HTTPS.
The problem was near impossible to find based on the error as well as it will show something akin to the following:
The HTTPS endpoint doesn't redirect at all.
Running crane verbose also doesn't clearly show the problem until you manually check each request it sends out and realize that it completely ignores the returned Location header it received when attempting to access the registry by HTTP.
It keeps retrying over and over on the HTTP endpoint, then eventually reaching 10 redirects (which it technically didn't, it only ever hits 1 but 10 times because it never respects the redirect somehow).
Example logging:
The text was updated successfully, but these errors were encountered: