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

Configuration example using imports statement for git repos causes application crash #2737

Open
andersbulderbank opened this issue Oct 18, 2023 · 1 comment
Labels
kind/bug Something isn't working

Comments

@andersbulderbank
Copy link

What happened?
When configuring devspace.yaml with an import statement following the format of the documentation, devspace CLI commands fail with a stack trace.

Stack trace
panic: runtime error: index out of range [1] with length 1

goroutine 1 [running]:
github.com/loft-sh/devspace/pkg/devspace/dependency/util.switchURLType({0xc0008cdac0?, 0x1b?})
        /Users/runner/work/devspace/devspace/pkg/devspace/dependency/util/util.go:75 +0x1f4
github.com/loft-sh/devspace/pkg/devspace/dependency/util.DownloadDependency({0x2766258, 0xc0001404b0}, {0xc000a20340, 0x30}, 0xc000be3438, {0x277ebb8, 0x4069640})
        /Users/runner/work/devspace/devspace/pkg/devspace/dependency/util/util.go:124 +0xfbe
github.com/loft-sh/devspace/pkg/devspace/config/loader.ResolveImports({0x2766258, 0xc0001404b0}, {0x276cbe0, 0xc000a23800}, {0xc000a20340, 0x30}, 0x277ebb8?, {0x277ebb8, 0x4069640})
        /Users/runner/work/devspace/devspace/pkg/devspace/config/loader/imports.go:74 +0x368
github.com/loft-sh/devspace/pkg/devspace/config/loader.(*configLoader).parseConfig(0xc0002f96d0, {0x2766258, 0xc0001404b0}, 0xc0004d37c0?, {0x2774400, 0xc000a23600}, {0xc0002cacd0?, 0x50?}, {0x0, 0x0}, ...)
        /Users/runner/work/devspace/devspace/pkg/devspace/config/loader/loader.go:317 +0x18b
github.com/loft-sh/devspace/pkg/devspace/config/loader.(*configLoader).LoadWithParser(0xc0002f96d0, {0x2766220, 0xc000a1b740}, {0x0?, 0x0?}, {0x0, 0x0}, {0x2746de0, 0xc0002cae10}, 0xc0002cae60, ...)
        /Users/runner/work/devspace/devspace/pkg/devspace/config/loader/loader.go:176 +0x7cd
github.com/loft-sh/devspace/cmd.parseConfig({0x2774db8, 0x4069c58})
        /Users/runner/work/devspace/devspace/cmd/root.go:350 +0x1f7
github.com/loft-sh/devspace/cmd.BuildRoot({0x2774db8, 0x4069c58}, 0x59?)
        /Users/runner/work/devspace/devspace/cmd/root.go:201 +0x186
github.com/loft-sh/devspace/cmd.Execute()
        /Users/runner/work/devspace/devspace/cmd/root.go:139 +0x50
main.main()
        /Users/runner/work/devspace/devspace/main.go:17 +0x2c

What did you expect to happen instead?
I expected the devspace command to import the github repository specified in the devspace.yaml file without errors.

How can we reproduce the bug? (as minimally and precisely as possible)
Configure devspace.yaml using the imports statement with a git repo as documented in the devspace documentation.

My devspace.yaml:

version: v2beta1

...
imports:
- git: github.com/project/repo.git
  branch: test

Working devspace.yaml, when changing to ssh-format it works as expected:

imports:
- git: git@github.com:project/repo.git
  branch: test

Local Environment:

  • DevSpace Version: 6.3.3
  • Operating System: linux
  • ARCH of the OS: AMD64

Kubernetes Cluster:

  • Cloud Provider: google
  • Kubernetes Version: 1.27.1

Anything else we need to know?

@andersbulderbank andersbulderbank added the kind/bug Something isn't working label Oct 18, 2023
@lizardruss
Copy link
Collaborator

@andersbulderbank Hello! Thanks for reporting the issue. The documentation could use a correction here, since we'd need to assume github.com/project/repo.git means either git@github.com/project/repo.git OR https://github.com/project/repo.git.

We'll likely do a quick fix to assume git@github.com/project/repo.git if the URL is left ambiguous, but for now using a more specific URL should be a quick workaround!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants