terraform/config
James Nugent cb9ef298f3 core: Defeat backward compatibilty in mapstructure
The mapstructure library has a regrettable backward compatibility
concern whereby a WeakDecode of []interface{}{} into a target of
map[string]interface{} yields an empty map rather than an error. One
possibility is to switch to using Decode instead of WeakDecode, but this
loses the nice handling of type conversion, requiring a large volume of
code to be added to Terraform or HIL in order to retain that behaviour.

Instead we add a DecodeHook to our usage of the mapstructure library
which checks for decoding []interface{}{} or []string{} into a map and
returns an error instead.

This has the effect of defeating the code added to retain backwards
compatibility in mapstructure, giving us the correct (for our
circumstances) behaviour of Decode for empty structures and the type
conversion of WeakDecode.

The code is identical to that in the HIL library, and packaged into a
helper.
2016-06-08 18:38:41 +01:00
..
module terraform: Module option to Import to add module to graph 2016-05-11 13:02:37 -07:00
test-fixtures config: Data source loading 2016-05-14 08:26:35 -07:00
append.go config: allow atlas block 2015-03-24 13:30:22 -07:00
append_test.go removed extra parentheses 2015-10-08 15:48:04 +03:00
config.go core: Defeat backward compatibilty in mapstructure 2016-06-08 18:38:41 +01:00
config_string.go config: "ResourceMode" concept for resources 2016-05-14 08:26:35 -07:00
config_test.go core: Fix go vet issues shown by Travis 2016-05-10 16:00:28 -04:00
config_tree.go config: make Merge an exported func 2014-07-18 17:05:22 -07:00
import_tree.go Condense switch fallthroughs into expr lists 2015-05-26 21:52:36 -04:00
interpolate.go config: Parsing of data.TYPE.NAME.FIELD variables 2016-05-14 08:26:35 -07:00
interpolate_funcs.go Allow specifying a default value to lookup() 2016-05-25 19:25:15 -05:00
interpolate_funcs_test.go Allow specifying a default value to lookup() 2016-05-25 19:25:15 -05:00
interpolate_test.go config: Parsing of data.TYPE.NAME.FIELD variables 2016-05-14 08:26:35 -07:00
interpolate_walk.go core: support native list variables in config 2016-05-10 14:49:14 -04:00
interpolate_walk_test.go core: support native list variables in config 2016-05-10 14:49:14 -04:00
lang.go remove config/lang, use hashicorp/hil 2016-02-03 13:24:04 -05:00
loader.go config: new HCL API 2015-11-07 16:53:42 -08:00
loader_hcl.go config: Data source loading 2016-05-14 08:26:35 -07:00
loader_hcl_test.go config: HCL loader 2014-08-11 09:58:53 -07:00
loader_test.go config: Data source loading 2016-05-14 08:26:35 -07:00
merge.go config: allow atlas block 2015-03-24 13:30:22 -07:00
merge_test.go removed extra parentheses 2015-10-08 15:48:04 +03:00
raw_config.go core: Use native HIL maps instead of flatmaps 2016-05-10 14:49:13 -04:00
raw_config_test.go remove config/lang, use hashicorp/hil 2016-02-03 13:24:04 -05:00
resource_mode.go config: "ResourceMode" concept for resources 2016-05-14 08:26:35 -07:00
resource_mode_string.go config: "ResourceMode" concept for resources 2016-05-14 08:26:35 -07:00