GoogleContainerTools / skaffold

Easy and Repeatable Kubernetes Development
https://skaffold.dev/
Apache License 2.0
15.06k stars 1.62k forks source link

skaffold v2 inspect command panicking when attempting usage on v2beta* yaml #7652

Closed aaron-prindle closed 2 years ago

aaron-prindle commented 2 years ago

I am in the process of testing Skaffold V2 across various projects/use-cases and attempted the following:

I then get this panic in the VS Code logs and the debugging does not work

[Cloud Code]: Validating deployment settings...
[Cloud Code]: Checking kubectl, skaffold dependencies...
[Cloud Code]: Failed to inspect modules: Error: panic: interface conversion: util.VersionedConfig is *v2.SkaffoldConfig, not *latest.SkaffoldConfig

goroutine 1 [running]:
,github.com/GoogleContainerTools/skaffold/pkg/skaffold/parser.getConfigs({_, _}, {{0x7fffe6721e11, 0x54}, {0x0, 0x0, 0x0}, {0x0, 0x0, 0x0}, ...}, ...)
    /tmpfs/src/github/skaffold/pkg/skaffold/parser/config.go:137 +0xa54
github.com/GoogleContainerTools/skaffold/pkg/skaffold/parser.GetConfigSet({_, _}, {{0x0, 0x0}, {0x7fffe6721e11, 0x54}, {0x0, 0x0}, {0x0, 0x0}, ...})
    /tmpfs/src/github/skaffold/pkg/skaffold/parser/config.go:85 +0x1a8
github.com/GoogleContainerTools/skaffold/pkg/skaffold/inspect/modules.PrintModulesList({_, _}, {_, _}, {{0x7fffe6721e11, 0x54}, {0x0, 0x0}, {0x7fffe6721e6f, 0x4}, ...})
    /tmpfs/src/github/skaffold/pkg/skaffold/inspect/modules/list.go:41 +0xb5
github.com/GoogleContainerTools/skaffold/cmd/skaffold/app/cmd.listModules({0x2d63cd8, 0xc0003c2240}, {0x2d0c520, 0xc00054c780})
    /tmpfs/src/github/skaffold/cmd/skaffold/app/cmd/inspect_modules.go:50 +0x11b
github.com/GoogleContainerTools/skaffold/cmd/skaffold/app/cmd.(*builder).NoArgs.func1(0x9b4420, {0xc000961b80, 0xc000961b58, 0x0})
    /tmpfs/src/github/skaffold/cmd/skaffold/app/cmd/commands.go:138 +0x66
github.com/GoogleContainerTools/skaffold/cmd/skaffold/app/cmd.applyPostRunHooks.func1(0xc0006662c0, {0xc0007494c0, 0x4, 0x4})
    /tmpfs/src/github/skaffold/cmd/skaffold/app/cmd/commands.go:185 +0x2f
github.com/spf13/cobra.(*Command).execute(0xc0006662c0, {0xc000749480, 0x4, 0x4})
    /Users/kbuilder/go/pkg/mod/github.com/spf13/cobra@v1.4.0/command.go:856 +0x60e
github.com/spf13/cobra.(*Command).ExecuteC(0xc000153400)
    /Users/kbuilder/go/pkg/mod/github.com/spf13/cobra@v1.4.0/command.go:974 +0x3bc
github.com/spf13/cobra.(*Command).ExecuteContextC(...)
    /Users/kbuilder/go/pkg/mod/github.com/spf13/cobra@v1.4.0/command.go:911
github.com/GoogleContainerTools/skaffold/cmd/skaffold/app.Run({0x2d0b6e0, 0xc000118008}, {0x2d0b6e0, 0xc000118010},)
    /tmpfs/src/github/skaffold/cmd/skaffold/app/skaffold.go:50 +0x2ad
main.main()
    /tmpfs/src/github/skaffold/cmd/skaffold/skaffold.go:49 +0x1e5
aaron-prindle commented 2 years ago

Using skaffold inspect directly (not via CC) on these manifests seems to work for me atm:

aprindle@aprindle ~/cloud-code-samples/golang/go-guestbook  [v1]$ skaffold inspect modules list --filename skaffol.yaml --format json
{"modules":[{"name":"frontend","path":"/usr/local/google/home/aprindle/cloud-code-samples/golang/go-guestbook/src/frontend/skaffold.yaml"},{"name":"backend","path":"/usr/local/google/home/aprindle/cloud-code-samples/golang/go-guestbook/src/backend/skaffold.yaml"}]}
aaron-prindle commented 2 years ago

Closing, it seems this was related to CC overwriting the V2 binary (it was still using V1 with this error). Everything appears to be working actually