Commit bfcda3f
committed
Avoids short-circuit issue where fileexists returns inconsistent results
In old versions of terraform, the ternary operator did not short-circuit,
and so the `was_missing` logic was a hack to workaround both paths executing
on every execution. The module needed the hack to avoid failing When the
package existed previously vs when it did not and was being created by the
module itself.
In recent-ish version of terraform, including the module min version 1.5.7,
the ternary operator will shortcircuit, so it will only execute the true OR
false logic, rather than both. This makes the `was_missing` logic unnecessary.
Further, in most recent versions of terraform, at least since 1.13.0, the
`was_missing` logic resulted in a failure when separately building the package
and then attempting to use the package in the same workflow. The failure occurred
because terraform became more strict at enforcing that the return values of the
`fileexists()` function be consistent between plan and apply phases.
Fixes #6981 parent 177ee12 commit bfcda3f
1 file changed
+3
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
11 | 10 | | |
12 | 11 | | |
13 | 12 | | |
14 | | - | |
15 | | - | |
| 13 | + | |
16 | 14 | | |
17 | 15 | | |
18 | 16 | | |
| |||
55 | 53 | | |
56 | 54 | | |
57 | 55 | | |
58 | | - | |
| 56 | + | |
59 | 57 | | |
60 | 58 | | |
61 | 59 | | |
| |||
182 | 180 | | |
183 | 181 | | |
184 | 182 | | |
185 | | - | |
| 183 | + | |
186 | 184 | | |
187 | 185 | | |
188 | 186 | | |
| |||
0 commit comments