Closed jcreager closed 3 years ago
I am facing a similar issue where tfmask
swallows the exit code of terraform plan -detailed-exitcode
.
@davidji99 I am now realizing that I completely forgot to update this issue. Try set -o pipefail;
.
set -o pipefail; exit 1 | tfmask
That should raise the correct exit code.
Oh thanks for the tip @jcreager!
Version: 0.7.0
Expected:
If a process piped to tfmask exits with non-zero exit code tfmask should also exit with a non-zero exit code.
Actual:
tfmask always exits with exit code zero regardless of exit code from piped process.
Steps to reproduce:
Additional Info:
I am using tfmask in conjunction with terragrunt and I am finding that although terragrunt will exit with a non-zero exit code if it encounters errors the final exit code is remains zero. This ends up being a problem with CI/CD pipelines that report success/failure based on final exit code.