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

Skaffold panic when run with empty skaffold.yaml #1216

Closed
rvrignaud opened this issue Oct 28, 2018 · 2 comments
Closed

Skaffold panic when run with empty skaffold.yaml #1216

rvrignaud opened this issue Oct 28, 2018 · 2 comments
Assignees
Labels
kind/bug Something isn't working

Comments

@rvrignaud
Copy link

Expected behavior

When run with an empty skaffold.yaml, I expect skaffold to output an error

Actual behavior

Skaffold crashes for most command dev, run, fix.

skaffold run
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x1e02a57]

goroutine 1 [running]:
github.com/GoogleContainerTools/skaffold/cmd/skaffold/app/cmd.newRunner(0x2f732e0, 0xc00036c5d0, 0x22def20, 0xc0004da840, 0xc00036c5d0)
	/private/tmp/skaffold-20181027-61272-omcjia/src/github.com/GoogleContainerTools/skaffold/cmd/skaffold/app/cmd/runner.go:36 +0x67
github.com/GoogleContainerTools/skaffold/cmd/skaffold/app/cmd.run(0x22c3d40, 0xc00000c018, 0x0, 0x0)
	/private/tmp/skaffold-20181027-61272-omcjia/src/github.com/GoogleContainerTools/skaffold/cmd/skaffold/app/cmd/run.go:49 +0x9d
github.com/GoogleContainerTools/skaffold/cmd/skaffold/app/cmd.NewCmdRun.func1(0xc0004eec80, 0x2f91d40, 0x0, 0x0, 0x0, 0x0)
	/private/tmp/skaffold-20181027-61272-omcjia/src/github.com/GoogleContainerTools/skaffold/cmd/skaffold/app/cmd/run.go:34 +0x33
github.com/GoogleContainerTools/skaffold/vendor/github.com/spf13/cobra.(*Command).execute(0xc0004eec80, 0x2f91d40, 0x0, 0x0, 0xc0004eec80, 0x2f91d40)
	/private/tmp/skaffold-20181027-61272-omcjia/src/github.com/GoogleContainerTools/skaffold/vendor/github.com/spf13/cobra/command.go:762 +0x473
github.com/GoogleContainerTools/skaffold/vendor/github.com/spf13/cobra.(*Command).ExecuteC(0x2f5e060, 0xc0004eef00, 0xc0004eec80, 0xc0004eea00)
	/private/tmp/skaffold-20181027-61272-omcjia/src/github.com/GoogleContainerTools/skaffold/vendor/github.com/spf13/cobra/command.go:852 +0x2fd
github.com/GoogleContainerTools/skaffold/vendor/github.com/spf13/cobra.(*Command).Execute(0x2f5e060, 0xc00000c018, 0x22c3d40)
	/private/tmp/skaffold-20181027-61272-omcjia/src/github.com/GoogleContainerTools/skaffold/vendor/github.com/spf13/cobra/command.go:800 +0x2b
github.com/GoogleContainerTools/skaffold/cmd/skaffold/app.Run(0x0, 0x0)
	/private/tmp/skaffold-20181027-61272-omcjia/src/github.com/GoogleContainerTools/skaffold/cmd/skaffold/app/skaffold.go:27 +0x58
main.main()
	/private/tmp/skaffold-20181027-61272-omcjia/src/github.com/GoogleContainerTools/skaffold/cmd/skaffold/skaffold.go:26 +0x22

Information

  • Skaffold version: version : v0.17.0
  • Operating system: macOS
  • Contents of skaffold.yaml: empty file

Steps to reproduce the behavior

  1. touch skaffold.yaml
  2. skaffold run
@aleksamagicka
Copy link

Same on Win 7 x64 Ultimate

@balopat balopat added the kind/bug Something isn't working label Oct 29, 2018
varunkashyap added a commit to varunkashyap/skaffold that referenced this issue Oct 30, 2018
The absence of apiVersion from skaffold.yaml hadn't been tested, a
nil err was being sent to errors.Wrapf which then returned nil as error
leading to wrong success of configuration parse operation.

We are now creating a new error instead of relying on wraping a
potentially nil err with errors.Wrapf.
r2d4 added a commit that referenced this issue Oct 30, 2018
Fixed panic if skaffold.yaml is empty (#1216)
@dgageot dgageot self-assigned this Nov 6, 2018
@dgageot
Copy link
Contributor

dgageot commented Nov 6, 2018

Fixed with #1221

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

4 participants