Closed pdecat closed 3 years ago
@pdecat Umm, very weird behavior. I can reproduce it. Since the fmt logic of tfupdate almost depends on hclwrite package in hcl2 library. So it may be a bug in upstream. I'll check it later. Thank you for reporting the issue!
@pdecat I confirmed the bug was caused by the hclwrite
parser, so I opened a new issue in upstream.
https://github.com/hashicorp/hcl/issues/402
As a workaround until fix, you can exclude any files with -i (--ignore-path)
option:
$ tfupdate terraform --help
Usage: tfupdate terraform [options] <PATH>
Arguments
PATH A path of file or directory to update
Options:
-v --version A new version constraint (default: latest)
If the version is omitted, the latest version is automatically checked and set.
-r --recursive Check a directory recursively (default: false)
-i --ignore-path A regular expression for path to ignore
If you want to ignore multiple directories, set the flag multiple times.
I worked it around with:
- disabled = ! (length(var.gke_network_policy) > 0 && var.gke_network_policy[0].enabled)
+ disabled = length(var.gke_network_policy) <= 0 || ! var.gke_network_policy[0].enabled
Surprisingly, it's the only line causing an issue in my somewhat large project.
@pdecat Fixed in v0.4.3 🎉
Hi,
I just came across this weird behavior with one of my configuration files which I have stripped down as the following minimal reproduction case: