-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
feat: respect custom exit code from plugin #6584
Conversation
Signed-off-by: knqyf263 <knqyf263@gmail.com>
Signed-off-by: knqyf263 <knqyf263@gmail.com>
Signed-off-by: knqyf263 <knqyf263@gmail.com>
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.
lgtm, should we consider the case if the plugin panics? I was thinking along the lines of a global panic handler.
Trivy calls plugins via OS command. IIUC, panic is just converted into exit status 2. I created a plugin causing panic.
Then, run the plugin through Trivy.
I hope it answers your question. |
Signed-off-by: knqyf263 <knqyf263@gmail.com>
Signed-off-by: knqyf263 <knqyf263@gmail.com>
Description
Trivy doesn't respect exit codes from plugins now and always exits with 1 if the plugin fails. This PR adds support for it.
Before
The
testplugin
always exits with 2.After
It exits with the code from a plugin and doesn't show usage and error anymore.
Checklist