Commit Graph

153 Commits

Author SHA1 Message Date
Mitchell Hashimoto 2e703afdad helper/schema: valiate should ignore computed fields 2014-10-16 14:04:45 -07:00
Mitchell Hashimoto 12c178bc63 helper/schema: don't ask for input if provider default would not be nil 2014-10-12 17:37:52 -07:00
Mitchell Hashimoto 59349cca11 helper/schema: sets must be treated atomically within ResourceData
This fixes a seemingly minor issue (GH-255) around plans showing changes
when in fact there are none. But in reality this turned out to uncover a
really terrible bug.

The effect of what was happening was that multiple items in a set were
being merged. Now, they were being merged in the right order, so if you
didn't have rich types (lists in a set) then you never saw the effect
since the later value would overwrite the earlier. But with lists (such
as in security groups), you would end up with the lists merging. So, if
you had one ingress rule with CIDR blocks and one with SGs, then after
the merge both ingress rules would have BOTH CIDR and SGs, resulting in
an incorrect plan (GH-255).

This fixes the issue by introducing a `getSourceExact` bitflag to the
ResourceData source. When this is set, ALL data must come from this
level, instead of merging lower levels. In the case of sets and diffs,
this is exactly what you want: "Get me the set 'foo' from the config and
the config ONLY (not the state or diff or w/e)".

Andddddd its fixed.

GH-255
2014-10-11 10:40:54 -07:00
Mitchell Hashimoto dcaf653d6f helper/schema: properly detect that a list is computed 2014-10-09 19:09:06 -07:00
Mitchell Hashimoto 753f6c6f8e helper/schema: fix failing tests 2014-10-08 18:25:31 -07:00
Mitchell Hashimoto 00bdef3093 providers/aws: test tag removal 2014-10-08 18:21:21 -07:00
Mitchell Hashimoto a7c321a028 helper/scheam: support UI defaults 2014-09-29 14:00:35 -07:00
Mitchell Hashimoto 99044a1f14 Add descriptions for AWS inputs 2014-09-29 13:30:28 -07:00
Mitchell Hashimoto 901c1448b4 command: make the UI a look nicer 2014-09-29 13:12:06 -07:00
Mitchell Hashimoto d9596fa4d0 helper/schema: don't ask for input on fields that have a value 2014-09-29 11:16:19 -07:00
Mitchell Hashimoto 5aed997223 helper/schema: Input support 2014-09-29 10:25:43 -07:00
Mitchell Hashimoto 9b2b3a963f ResourceDiff => InstanceDiff 2014-09-17 16:33:24 -07:00
Mitchell Hashimoto 81d9d70296 helper/schema: conforms to new API, tests pass 2014-09-16 17:07:13 -07:00
Mitchell Hashimoto 0250c17d6e helper/schema: DefaultFunc for dynamic defaults
/cc @c4milo - This might be useful to you as well.
2014-09-09 21:33:08 -07:00
Mitchell Hashimoto 5919637456 helper/schema: Defaults [GH-245] 2014-09-09 21:17:29 -07:00
Mitchell Hashimoto c9a541d95b helper/schema: generate a full diff in destroy/create cycle 2014-08-27 15:45:52 -07:00
Mitchell Hashimoto 9d239eea60 helper/schema: detect no change computed for sets/lists properly 2014-08-27 15:03:42 -07:00
Mitchell Hashimoto 0c9b65f3f4 helper/schema: documentation 2014-08-26 21:52:09 -07:00
Mitchell Hashimoto 56cf1e6faa Fix go vet complaints 2014-08-24 21:50:35 -07:00
Mitchell Hashimoto 95bd64132b helper/schema: update docs 2014-08-24 16:53:42 -07:00
Mitchell Hashimoto 31cc3ffca1 helper/schema: one of Optional, Required, Computed must be set 2014-08-24 16:53:41 -07:00
Mitchell Hashimoto eff8306a6c helper/schema: don't mark things computed if an ID is set 2014-08-22 12:18:08 -07:00
Mitchell Hashimoto 50026a6d5c helper/schema: When having a StateFunc, make sure NewExtra contains
original
2014-08-22 08:57:44 -07:00
Mitchell Hashimoto d009ea800a helper/schema: add support for StateFunc 2014-08-22 08:45:54 -07:00
Mitchell Hashimoto 4015d942ab providers/aws: security group ingress rules treated as set [GH-87]
/cc @pearkes - !!!
2014-08-20 22:24:13 -07:00
Mitchell Hashimoto e9cc09a886 helper/schema: improve InternalValidate for sets 2014-08-20 21:13:18 -07:00
Mitchell Hashimoto 9ab5577beb helper/schema: set diff tests 2014-08-20 21:09:07 -07:00
Mitchell Hashimoto 475528adc3 helper/schema: Set operations 2014-08-20 21:09:06 -07:00
Mitchell Hashimoto 56dde5c0c1 helper/schema: can read and get the state of sets 2014-08-20 21:09:06 -07:00
Mitchell Hashimoto 5e975e47cf helper/schema: diffing should use ResourceData for guidance 2014-08-20 18:11:40 -07:00
Mitchell Hashimoto c4664a81e6 helper/schema: show computed lists in diffs 2014-08-18 21:22:27 -07:00
Mitchell Hashimoto 5a5ef67d87 helper/schema: don't forward computing onto elements 2014-08-18 19:08:32 -07:00
Mitchell Hashimoto 801b220dc7 helper/schema: can diff lists more correctly 2014-08-18 16:54:30 -07:00
Mitchell Hashimoto e70522f4ca helper/schema: if you can't find the list, just fall through to return
nil
2014-08-18 15:46:26 -07:00
Mitchell Hashimoto 4ae1673580 helper/schema: support for NewRemoved 2014-08-18 15:07:09 -07:00
Mitchell Hashimoto ce42845acd helper/schema: use reflection to build []interface{} 2014-08-18 14:24:04 -07:00
Mitchell Hashimoto 17d29f7949 helper/schema: use reflection to verify list 2014-08-18 14:21:36 -07:00
Mitchell Hashimoto 4c9271160e helper/schema: can handle maps 2014-08-18 14:00:03 -07:00
Mitchell Hashimoto 51a44db6c2 helper/schema: move InternalValidate to schemaMap 2014-08-17 14:50:44 -07:00
Mitchell Hashimoto 43e4921bd9 helper/schema: more tests, todo tests for computedwhen 2014-08-16 13:32:21 -07:00
Mitchell Hashimoto 7bc0be4b81 helper/schema: couple more tests around Computed (+ fix) 2014-08-16 09:49:22 -07:00
Mitchell Hashimoto 3a46d21527 helper/schema: computed fields cannot be set 2014-08-16 09:18:45 -07:00
Mitchell Hashimoto 90f462e609 helper/schema: detect invalid/unknown keys 2014-08-15 22:15:10 -07:00
Mitchell Hashimoto 4af387b986 helper/schema: validation 2014-08-15 22:00:16 -07:00
Mitchell Hashimoto 31067ee8f6 helper/schema: ResourceData, starting tests 2014-08-15 16:32:43 -07:00
Mitchell Hashimoto 660dc68a86 helper/schema: more tests 2014-08-15 10:39:40 -07:00
Mitchell Hashimoto d05b9d6193 helper/schema: can diff complex resource 2014-08-15 10:25:25 -07:00
Mitchell Hashimoto 878d844f5c helper/schema: comment 2014-08-14 23:33:30 -07:00
Mitchell Hashimoto 7f14708e71 helper/schema: list ForceNew 2014-08-14 23:32:20 -07:00
Mitchell Hashimoto 22e286ffd5 helper/schema: diff-ing lists at a basic level 2014-08-14 23:17:53 -07:00
Mitchell Hashimoto 46d911325a helper/schema: Bools and ints can decode 2014-08-14 20:02:52 -07:00
Mitchell Hashimoto efa2335886 helper/schema: start the Diff function 2014-08-14 19:55:47 -07:00
Mitchell Hashimoto 01b6b5f48e helper/schema: initial work 2014-08-13 14:23:22 -07:00