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

Conftest doesn't exit with plugin exit code #741

Open
iAlexBLR opened this issue Sep 29, 2022 · 3 comments
Open

Conftest doesn't exit with plugin exit code #741

iAlexBLR opened this issue Sep 29, 2022 · 3 comments
Labels
bug Something isn't working

Comments

@iAlexBLR
Copy link

Issue:

I've created a conftest plugin for some custom behaviour, but I noticed that conftest when uses installed plugin always returns 0 exit code even if plugin itself returns another one.

Reproduce steps:

script.sh

#!/usr/bin/env bash
set -e
exit 1

plugin.yaml

name: script
version: 0.1.0
usage: conftest script
command: ./script.sh

Testing:

% ./script.sh
% echo $?
1
%
% conftest plugin install .
% conftest script
% echo $?
0
@jalseth jalseth added the bug Something isn't working label Oct 1, 2022
@jalseth
Copy link
Member

jalseth commented Oct 1, 2022

Thanks for raising this. If you have the time, I'd welcome a PR to fix.

@iAlexBLR
Copy link
Author

iAlexBLR commented Oct 5, 2022

@jalseth unfortunately I'm not that good at programming on Go

@jpreese
Copy link
Member

jpreese commented Oct 19, 2022

@iAlexBLR this is sort of by design, see: https://www.conftest.dev/plugins/ (at the bottom)

It has been a long time since I've dealt with plugins in Conftest, but do recall plugins needing to specify other error codes. I can see how this can be confusing though, and I don't recall the technical reason for it unfortunately.

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

No branches or pull requests

3 participants