The `raw` result should take container exit status into consideration
Brunomachadob opened this issue · comments
Describe the solution you'd like
I am trying to build a plugin that needs to run a simple task, which will always output everything in plain text format into the stdout and exit with either 0
or 1
. Based on that, I believe it makes sense to make use of the result-format: raw
format.
The problem is that no matter the exit code I use, sonobuoy interprets it as a success
, just because it could stat
the file with the outcomes, as stated here:
sonobuoy/pkg/client/results/raw.go
Lines 26 to 27 in 6f9e27f
It would be nice to have this result to take the container exit code into consideration, as the report could be a success or failure, not depending on the file existing or not, but based on the exit code.
Anything else you would like to add:
Here's an example plugin config:
sonobuoy-config:
driver: Job
plugin-name: simple-plugin
result-format: raw
spec:
command:
- sh
args: ["-c", "echo whatever > ${SONOBUOY_RESULTS_DIR}/report.txt; echo ${SONOBUOY_RESULTS_DIR}/report.txt > ${SONOBUOY_RESULTS_DIR}/done; exit 1"]
image: bitnami/kubectl:latest
name: simple-plugin
imagePullPolicy: Always
resources: {}
volumeMounts:
- mountPath: /tmp/sonobuoy/results
name: results
Being executed with:
sonobuoy run --sonobuoy-image sonobuoy/sonobuoy:latest --plugin simple-plugin.yaml
Environment:
- Sonobuoy version: v0.57.1
- Kubernetes version: v1.27.10-eks-508b6b3
- Cloud provider or hardware configuration: EKS
- OS (e.g. from
/etc/os-release
): MacOS