mirror of
https://github.com/open-policy-agent/opa.git
synced 2026-08-13 03:42:35 -06:00
235ee309da
Adds the ability to exit with a non-zero exit code for 'opa exec' by adding the --fail and --fail-defined flags matching their respective behaviors in 'opa eval': - Setting the --fail-defined flag allows exit of opa exec with a zero code if all results are undefined and there are no errors, or a non-zero code in the event of any defined results and/or errors. On non-zero exits the error message includes the number of failures/errors as well as a reference to the --fail-defined flag being set. - The --fail flag behaves as the inverse of --fail-defined. Fixes: #5007 Signed-off-by: Byron Lagrone <byron.lagrone@seqster.com>