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

Camel K CLI panics when unknown command is passed #3203

Closed
tadayosi opened this issue Apr 14, 2022 · 0 comments · Fixed by #3204
Closed

Camel K CLI panics when unknown command is passed #3203

tadayosi opened this issue Apr 14, 2022 · 0 comments · Fixed by #3204
Assignees
Labels
area/cli Kamel CLI kind/bug Something isn't working

Comments

@tadayosi
Copy link
Member

With the latest snapshot:

$ ./kamel aaa
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x1f8 pc=0x1cf9de6]

goroutine 1 [running]:
github.com/spf13/cobra.(*Command).getErr(0x0, 0x2811540, 0xc000134010, 0x1, 0x1)
	github.com/spf13/cobra@v1.4.0/command.go:344 +0x26
github.com/spf13/cobra.(*Command).ErrOrStderr(...)
	github.com/spf13/cobra@v1.4.0/command.go:325
github.com/apache/camel-k/pkg/cmd.NewKamelWithModelineCommand(0x28598b8, 0xc000a27b40, 0xc00013a000, 0x2, 0x2, 0xc00008c748, 0x390dde0, 0x0, 0xc00008c778, 0xc000b3ff78, ...)
	github.com/apache/camel-k/pkg/cmd/modeline.go:74 +0x426
main.main()
	command-line-arguments/main.go:44 +0x166

For 1.8.2 it just shows:

$ kamel182 aaa
Error: unknown command "aaa" for "kamel"
@tadayosi tadayosi added kind/bug Something isn't working area/cli Kamel CLI labels Apr 14, 2022
@tadayosi tadayosi self-assigned this Apr 14, 2022
tadayosi added a commit to tadayosi/camel-k that referenced this issue Apr 14, 2022
Fix apache#3203

createKamelWithModelineCommand() should always return rootCmd instance
even when it gets err, as its out and err outputs may be used downstream.
tadayosi added a commit that referenced this issue Apr 15, 2022
Fix #3203

createKamelWithModelineCommand() should always return rootCmd instance
even when it gets err, as its out and err outputs may be used downstream.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/cli Kamel CLI kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant