Skip to content

remove scope for registry login#718

Merged
AkihiroSuda merged 2 commits intocontainerd:masterfrom
junnplus:registry-login
Jan 26, 2022
Merged

remove scope for registry login#718
AkihiroSuda merged 2 commits intocontainerd:masterfrom
junnplus:registry-login

Conversation

@junnplus
Copy link
Copy Markdown
Member

Signed-off-by: ye.sijun [email protected]

Fixes: #717

@junnplus
Copy link
Copy Markdown
Member Author

junnplus commented Jan 20, 2022

panic: runtime error: slice bounds out of range [:1] with capacity 0

goroutine 1 [running]:
github.com/containerd/containerd/remotes/docker.GetTokenScopes({0x15a4338, 0xc00003e0a0}, {0x0, 0x0, 0x0})
        /home/jun.linux/go/pkg/mod/github.com/containerd/[email protected]/remotes/docker/scope.go:96 +0x28f
github.com/containerd/containerd/remotes/docker.(*authHandler).doBearerAuth(0xc0001c4a20, {0x15a4338, 0xc00003e0a0})
        /home/jun.linux/go/pkg/mod/github.com/containerd/[email protected]/remotes/docker/authorizer.go:274 +0xb9
github.com/containerd/containerd/remotes/docker.(*authHandler).authorize(0xc0000b3900, {0x15a4338, 0xc00003e0a0})
        /home/jun.linux/go/pkg/mod/github.com/containerd/[email protected]/remotes/docker/authorizer.go:253 +0x39
github.com/containerd/containerd/remotes/docker.(*dockerAuthorizer).Authorize(0xc0000b3900, {0x15a4338, 0xc00003e0a0}, 0xc00003c300)
        /home/jun.linux/go/pkg/mod/github.com/containerd/[email protected]/remotes/docker/authorizer.go:126 +0x6d
main.tryLoginWithRegHost({0x15a4338, 0xc00003e0a0}, {0xc0002d94a0, {0x158db10, 0xc0000b3900}, {0x7fff8feacda0, 0x21}, {0x1298980, 0x5}, {0x129667c, ...}, ...})
        /Users/jun/Documents/workspace/nerdctl/cmd/nerdctl/login.go:269 +0x2b4
main.loginClientSide({0x15a4338, 0xc00003e0a0}, 0xc00032e780, {{0x7fff8feacdc5, 0x15}, {0x7fff8feacdde, 0xf}, {0x0, 0x0}, {0x0, ...}, ...})
        /Users/jun/Documents/workspace/nerdctl/cmd/nerdctl/login.go:237 +0x7e8
main.loginAction(0xc00032e780, {0xc000403ce0, 0x1, 0x6})
        /Users/jun/Documents/workspace/nerdctl/cmd/nerdctl/login.go:101 +0x290
github.com/spf13/cobra.(*Command).execute(0xc00032e780, {0xc00003a0a0, 0x6, 0x6})
        /home/jun.linux/go/pkg/mod/github.com/spf13/[email protected]/command.go:856 +0x60e
github.com/spf13/cobra.(*Command).ExecuteC(0xc00037fb80)
        /home/jun.linux/go/pkg/mod/github.com/spf13/[email protected]/command.go:974 +0x3bc
github.com/spf13/cobra.(*Command).Execute(...)
        /home/jun.linux/go/pkg/mod/github.com/spf13/[email protected]/command.go:902
main.xmain()
        /Users/jun/Documents/workspace/nerdctl/cmd/nerdctl/main.go:85 +0x9f
main.main()
        /Users/jun/Documents/workspace/nerdctl/cmd/nerdctl/main.go:68 +0x19

https://github.com/containerd/containerd/blob/main/remotes/docker/scope.go#L85-L96
empty scopes will cause GetTokenScopes to panic.

@AkihiroSuda
Copy link
Copy Markdown
Member

@junnplus containerd/containerd#6463 seems merged, could you update this PR ?

@junnplus junnplus marked this pull request as ready for review January 22, 2022 07:57
@junnplus
Copy link
Copy Markdown
Member Author

@AkihiroSuda Updated, but need help. Run action containerd/project-checks failed, am i missing something?

  To proceed despite packages unresolved in go 1.16:
  	go mod tidy -e
  If reproducibility with go 1.16 is not needed:
  	go mod tidy -compat=1.17
  For other options, see:
  	https://golang.org/doc/modules/pruning

@AkihiroSuda
Copy link
Copy Markdown
Member

go mod tidy -compat=1.17

Could you try this?

@junnplus
Copy link
Copy Markdown
Member Author

junnplus commented Jan 22, 2022

Could you try this?

I mean ci can't be green, it's ok locally

@AkihiroSuda
Copy link
Copy Markdown
Member

Could you try that command and push to this PR, and see whether CI passes?

@junnplus
Copy link
Copy Markdown
Member Author

@AkihiroSuda
Copy link
Copy Markdown
Member

Updated PR to use containerd/project-checks#4

@AkihiroSuda
Copy link
Copy Markdown
Member

And rebased

@AkihiroSuda AkihiroSuda force-pushed the registry-login branch 2 times, most recently from bb8d42d to ffca709 Compare January 26, 2022 02:57
AkihiroSuda and others added 2 commits January 26, 2022 18:19
Signed-off-by: ye.sijun <[email protected]>
Signed-off-by: Akihiro Suda <[email protected]>
@AkihiroSuda AkihiroSuda merged commit d1918df into containerd:master Jan 26, 2022
@junnplus junnplus mentioned this pull request Jan 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

registry login failed: 400

2 participants