Skip to content
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

The context here may not have Fly-specific keys #2322

Closed
wants to merge 2 commits into from
Closed

Conversation

kzys
Copy link
Member

@kzys kzys commented May 22, 2023

Fixing the panic below.

panic: interface conversion: interface {} is nil, not *config.Config

goroutine 68 [running]:
github.com/superfly/flyctl/internal/config.FromContext(...)
/home/runner/work/flyctl/flyctl/internal/config/context.go:15
github.com/superfly/flyctl/internal/build/imgsrc.authConfigs({0x1d5c6a8, 0xc000dfff80})
/home/runner/work/flyctl/flyctl/internal/build/imgsrc/docker.go:428 +0x276
github.com/superfly/flyctl/internal/build/imgsrc.(*buildkitAuthProvider).Credentials(0x16?, {0x1d5c6a8?, 0xc000dfff80?}, 0xc000dfb2f0)
/home/runner/work/flyctl/flyctl/internal/build/imgsrc/buildkit.go:151 +0x4c

Fixing the panic below.

```
panic: interface conversion: interface {} is nil, not *config.Config

goroutine 68 [running]:
github.com/superfly/flyctl/internal/config.FromContext(...)
/home/runner/work/flyctl/flyctl/internal/config/context.go:15
github.com/superfly/flyctl/internal/build/imgsrc.authConfigs({0x1d5c6a8, 0xc000dfff80})
/home/runner/work/flyctl/flyctl/internal/build/imgsrc/docker.go:428 +0x276
github.com/superfly/flyctl/internal/build/imgsrc.(*buildkitAuthProvider).Credentials(0x16?, {0x1d5c6a8?, 0xc000dfff80?}, 0xc000dfb2f0)
/home/runner/work/flyctl/flyctl/internal/build/imgsrc/buildkit.go:151 +0x4c
```
@pborzenkov
Copy link
Contributor

pborzenkov commented May 22, 2023

I think this re-introduces the same problem that my original PR was trying to fix: -t flag is gonna be ignored by getAPIToken().

How about passing the token to newBuildkitAuthProvider() and, respectively, authConfigs() (and drop context.Context argument from authConfigs())?

@kzys
Copy link
Member Author

kzys commented May 22, 2023

Oh that was the intention. Sorry I didn't read your PR carefully...

@kzys
Copy link
Member Author

kzys commented May 22, 2023

Merged #2324 instead. @pborzenkov would work on its actual fix.

@kzys kzys closed this May 22, 2023
@dangra dangra deleted the fix-auth branch August 29, 2023 16:45
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.

None yet

2 participants