Commit Graph

28 Commits

Author SHA1 Message Date
James Bardin 16597d4a55 Nested lists and maps fail in GetRaw
When referencing a list of maps variable from within a resource, only
the first list element is included the plan. This is because GetRaw
can't access the interpolated values. Add some tests to document this
behavior for both Get and GetRaw.
2016-11-28 09:04:12 -05:00
James Bardin 8f6583c264 Add test for ResourceConfig.Get
ResourceConfig.Get could previously return (nil, true) when looking up
an interpolated map in a list because of the indexing ambiguity. Make
sure we test that a non-existent value always returns false.
2016-11-21 10:09:21 -05:00
Mitchell Hashimoto 9b5b122f14
terraform: ResourceConfig reimplementation for TypeUnknown
The primary change here is to expect that Config contains computed
values. This introduces `unknownCheckWalker` that does a really basic
reflectwalk to look for computed values and use that for IsComputed.

We had a weird mixture before checking whether c.Config was simply
missing values to determine where to look. Now we rely on IsComputed
heavily.
2016-11-09 14:28:16 -08:00
Mitchell Hashimoto 29485f6167
terraform: ResourceConfig.IsComputed cases 2016-11-09 14:28:15 -08:00
Mitchell Hashimoto 0c271b2b2d
terraform: better detection of unknown values in ResourceConfig, tests 2016-11-09 14:28:15 -08:00
Mitchell Hashimoto 9cc5e81a6c
terraform: add tests for IsComputed that pass on master 2016-11-09 14:28:15 -08:00
Mitchell Hashimoto 3dd64d9f2e
terraform: ResourceConfig.Equal should sort ComputedKeys
This was causing otherwise equal ResourceConfigs to report non-equal
which was incorrect, thus causing incorrect shadow graph errors.
2016-10-22 12:00:05 -07:00
Mitchell Hashimoto 30596ca371
terraform: sanity test (passes, always passed) 2016-10-11 22:17:31 +08:00
Mitchell Hashimoto d37bb87bf2
terraform: ResourceConfig.DeepCopy should handle the nil case 2016-10-11 22:17:27 +08:00
Mitchell Hashimoto f73dc844c7
wip 2016-10-11 22:17:27 +08:00
Mitchell Hashimoto f897fa4701
terraform: ResourceConfig.Equal and tests 2016-09-27 18:52:32 -07:00
Mitchell Hashimoto 56901e5cfd
terraform: ResourceConfig.DeepCopy
This implements DeepCopy, still need to implement Equals to make this
more useful. Coming in the next commit but this still has its own full
functionality + tests.
2016-09-27 16:09:32 -07:00
James Bardin 87a5ce8045 Add tests for maps with dots
This adds some unit tests for config maps with dots in the key values.
We check for maps with keys which have overlapping names. There are
however still issues with nested maps which create overlapping flattened
names, as well as nested lists with dots in the key.
2016-07-20 14:08:14 -04:00
Mitchell Hashimoto 8be4afacf8 terraform: replace config/lang usage 2016-02-03 13:24:04 -05:00
Mitchell Hashimoto e37c187228 terraform: goodbye context.go (old) 2015-02-19 12:08:32 -08:00
Mitchell Hashimoto c2df70e499 terraform: complete more nodes 2015-02-19 12:07:54 -08:00
Mitchell Hashimoto ea18b62e8f terraform: count.index 2014-10-02 22:02:59 -07:00
Mitchell Hashimoto 1835a03842 terraform: hook parameter is an InstanceInfo 2014-09-25 10:40:44 -07:00
Mitchell Hashimoto 1b5d0ed0bb terraform: outputs should be properly calculated for modules now 2014-09-23 15:46:20 -07:00
Mitchell Hashimoto c164839ed1 terraform: walkContext 2014-09-23 13:21:45 -07:00
Mitchell Hashimoto 7a97396583 terraform: remove unused function 2014-09-21 22:35:11 -07:00
Mitchell Hashimoto 73e2a43427 terraform: don't put the ResourceState in Resource 2014-09-21 22:08:21 -07:00
Armon Dadgar 4b0f970659 terraform: fixing test errors 2014-09-16 15:09:40 -07:00
Mitchell Hashimoto 281b59533d fmt 2014-09-09 21:44:40 -07:00
Mitchell Hashimoto 9573d1bfec terraform: test to make sure nil in RawConfig is okay 2014-09-09 17:41:05 -07:00
Mitchell Hashimoto 9ecfdc350e terraform: ResourceConfig.Get doesn't panic if exceed list bounds
[GH-210]
2014-08-21 11:37:14 -07:00
Mitchell Hashimoto d8a999e5af terraform: ResourceConfig.Get gets interpolated if possible 2014-08-19 09:05:19 -07:00
Mitchell Hashimoto 361dbb14ae terraform: test for Resource.Vars 2014-06-30 20:59:23 -07:00