Skip to content

Commit cdb0052

Browse files
authored
Merge pull request #735 from Junnplus/login-404
fix ghcr login 404 again
2 parents d0fe31d + 054f793 commit cdb0052

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

cmd/nerdctl/login.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -256,17 +256,17 @@ func tryLoginWithRegHost(ctx context.Context, rh docker.RegistryHost) error {
256256
if rh.Authorizer == nil {
257257
return errors.New("got nil Authorizer")
258258
}
259-
u := url.URL{
260-
Scheme: rh.Scheme,
261-
Host: rh.Host,
262-
Path: rh.Path,
263-
}
264259
if rh.Path == "/v2" {
265260
// If the path is using /v2 endpoint but lacks trailing slash add it
266261
// https://docs.docker.com/registry/spec/api/#detail. Acts as a workaround
267262
// for containerd issue https://github.com/containerd/containerd/blob/2986d5b077feb8252d5d2060277a9c98ff8e009b/remotes/docker/config/hosts.go#L110
268263
rh.Path = "/v2/"
269264
}
265+
u := url.URL{
266+
Scheme: rh.Scheme,
267+
Host: rh.Host,
268+
Path: rh.Path,
269+
}
270270
ctx = docker.WithScope(ctx, "")
271271
var ress []*http.Response
272272
for i := 0; i < 10; i++ {

0 commit comments

Comments
 (0)