Commit Graph

12 Commits

Author SHA1 Message Date
Martin Atkins
fc20f419dd config and command: use errwrap to propagate config load errors
Previously we were using fmt.Sprintf and thus forcing the stringification
of the wrapped error.

Using errwrap allows us to unpack the original error at the top of the
stack, which is useful when the wrapped error is really a hcl.Diagnostics
containing potentially-multiple errors and possibly warnings.
2017-10-06 11:46:07 -07:00
Martin Atkins
d91327eaa0 config: allow HCL2 experiment opt-in (build-time flag to enable)
Use the new HCL2 config loader when the opt-in comment #terraform:hcl2 is
present in a .tf file.

For now this is disabled for "normal" builds and enabled only if
explicitly configured via a linker flag during build. This is because it's
not yet in a good state to be released: the HCL2 loader produces RawConfig
objects that the validator and interpolator can't yet deal with, and so
using HCL2 for anything non-trivial currently causes Terraform to crash
in real use.
2017-10-03 17:47:01 -07:00
Sam Boyer
b82bd0c280 Condense switch fallthroughs into expr lists 2015-05-26 21:52:36 -04:00
Mitchell Hashimoto
038cca291e config: HCL loader 2014-08-11 09:58:53 -07:00
Mitchell Hashimoto
06cdd4fa42 config: LoadDir loads override files 2014-07-20 17:52:46 -07:00
Mitchell Hashimoto
9cd1018f0b config: config files can be in JSON, as well 2014-07-18 16:54:52 -07:00
Mitchell Hashimoto
9d028ab6de config: reword for ".tf" extension force 2014-07-11 20:05:38 -07:00
Mitchell Hashimoto
3728e1cfc0 fmt 2014-05-24 12:51:31 -07:00
Mitchell Hashimoto
f22cc62b2c config: better memory management for libucl 2014-05-23 16:30:28 -07:00
Mitchell Hashimoto
14a25e6b58 config: merge configs 2014-05-23 16:09:41 -07:00
Mitchell Hashimoto
aadb24aa08 config: error if unknown filetype 2014-05-23 15:42:29 -07:00
Mitchell Hashimoto
04d88b0540 config: move things out into more files 2014-05-23 15:35:18 -07:00