-
Notifications
You must be signed in to change notification settings - Fork 22
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
Fixing jf dockerscan command panic #154
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is the panic? please add to the description.
I could not replicate the issue.
Also this is a hidden command that inject and shows the HELP
for jf docker scan
it is not a command on its own.
@attiasas When running jf dockerscan even if by accident we're getting panic instead of handling. Take in account that if we're running something close to jf dockerscan it will output: |
@dortam888 , As discussed, this needs to be behave similar to |
Description: "The docker image tag to scan.", | ||
}, | ||
} | ||
func GetArguments() string { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return this as []components.Argument as we do so for all other commands. we don't want to create a different types just for one single command
dev
branch.go vet ./...
.go fmt ./...
.the JFrog cli might offer jf dockerscan as a command as its appearing on the command list but it has no Action function.
Added an action function to return the same output as jf docker scan would return.
When running jf dockerscan:
jf dockerscan
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x0 pc=0x1048cbc40]
goroutine 1 [running]:
github.com/jfrog/jfrog-cli-core/v2/plugins/components.convertCommand.getActionFunc.func2(0x14000341718?)
github.com/jfrog/jfrog-cli-core/[email protected]/plugins/components/conversionlayer.go:374 +0x50
github.com/urfave/cli.HandleAction({0x105275ea0?, 0x14000419110?}, 0xa?)
github.com/urfave/[email protected]/app.go:522 +0xd8
github.com/urfave/cli.Command.Run({{0x104e7826d, 0xa}, {0x0, 0x0}, {0x0, 0x0, 0x0}, {0x104f08f05, 0x39}, {0x1400049eba0, ...}, ...}, ...)
github.com/urfave/[email protected]/command.go:175 +0x530
github.com/urfave/cli.(*App).Run(0x140003b41c0, {0x140000300a0, 0x2, 0x2})
github.com/urfave/[email protected]/app.go:277 +0x7ec
main.execMain()
github.com/jfrog/jfrog-cli/main.go:132 +0x454
main.main()
github.com/jfrog/jfrog-cli/main.go:69 +0x20
Fixing it by making it a n help command.
with: jfrog/jfrog-cli#2726