terraform/flatmap
Martin Atkins 606e7c991f flatmap: be resilient to lying "foo.#" key
We use the .# key primarily as a hint that we have a list, but its value
describes how many items the writer thinks were in the list.

Since this information is redundant with the _actual_ data, it's
potentially useful as a form of corrupted data detection but this function
isn't equipped to actually report on such a problem (no error return
value, and not in a good place for UI feedback anyway), so instead we'll
largely ignore this value and just go by the number of items we
encounter.

The result of this is that when the counts mismatch we will go by the
number of items actually holding the prefix, rather than panicking as
we would've before.

This fixes the crashes in #15300, #15135 and #15334, though it does not
address any root-cause for the count to be incorrect in the first place,
so there may be something to fix here somewhere else.
2017-06-23 14:47:36 -07:00
..
expand.go flatmap: be resilient to lying "foo.#" key 2017-06-23 14:47:36 -07:00
expand_test.go flatmap: be resilient to lying "foo.#" key 2017-06-23 14:47:36 -07:00
flatten.go
flatten_test.go
map.go fmt 2014-07-14 21:56:34 -07:00
map_test.go