Remove more registry v1 code#39371
Conversation
f25fa78 to
1bde9e5
Compare
|
Tests are failing @tiborvass |
2473c1d to
3b9dc70
Compare
Codecov Report
@@ Coverage Diff @@
## master #39371 +/- ##
=========================================
Coverage ? 37.41%
=========================================
Files ? 609
Lines ? 45108
Branches ? 0
=========================================
Hits ? 16875
Misses ? 25944
Partials ? 2289 |
|
needs rebase |
3b9dc70 to
bead3a3
Compare
bead3a3 to
bc5f563
Compare
|
Rebased to first a fresh run of CI |
|
Various tests are still failing (same error at a glance); Looks like it doesn't use / ignores the default |
Signed-off-by: Tibor Vass <[email protected]>
Signed-off-by: Tibor Vass <[email protected]>
bc5f563 to
fadaf90
Compare
| } | ||
|
|
||
| return "", "", err | ||
| return loginV2(authConfig, endpoint, userAgent) |
There was a problem hiding this comment.
I think this is where the problem is for the failing test; previously this was returning a fallbackError if;
- the registry didn't support
v2(in which case it would fallback tov1 - connecting with the registry using
httpsfailed, and the registry we're connecting to is marked asinsecure registry
In the latter case, it should continue trying the next (non-https) endpoint, and currently we only try the first endpoint in the list.
Not sure if we should continue trying on every type of error though (authentication failed errors should likely not be ignored)
| return nil, false, err | ||
| return nil, err | ||
| } | ||
| resp, err := pingClient.Do(req) | ||
| if err != nil { | ||
| return nil, false, err | ||
| return nil, err | ||
| } | ||
| defer resp.Body.Close() | ||
|
|
||
| versions := auth.APIVersions(resp, DefaultRegistryVersionHeader) | ||
| for _, pingVersion := range versions { | ||
| if pingVersion == v2Version { | ||
| // The version header indicates we're definitely | ||
| // talking to a v2 registry. So don't allow future | ||
| // fallbacks to the v1 protocol. | ||
|
|
||
| foundV2 = true | ||
| break | ||
| } | ||
| } |
There was a problem hiding this comment.
Wondering if we should keep some of the v1 detection logic so that we can return a more informative error ("registry is v1, which is no longer supported, see https://docs.docker.com/go/registry-v1")
|
Rebased this PR, as #41599 was merged |
Follow up to #39365