Mitchell Hashimoto
c6fd938fb8
terraform: EvalInstanceInfo on data sources in new graph
...
This doesn't cause any practical issues as far as I'm aware (couldn't
get any test to fail), but caused shadow errors since it wasn't matching
the prior behavior.
2016-11-15 09:02:10 -08:00
Mitchell Hashimoto
6557a3de18
helper/shadow: Close for auto-closing all values
...
Fixes #10122
The simple fix was that we forgot to close `ReadDataApply` for the
provider. But I've always felt that this section of the code was brittle
and I wanted to put in a more robust solution. The `shadow.Close` method
uses reflection to automatically close all values.
2016-11-15 08:54:26 -08:00
Mitchell Hashimoto
66ccc19d94
Merge pull request #9973 from hashicorp/f-new-plan
...
terraform: new plan graph
2016-11-09 08:15:40 -08:00
Mitchell Hashimoto
337abe3f62
terraform: enable plan shadow graph
2016-11-08 13:59:30 -08:00
Mitchell Hashimoto
d338a1ef88
terraform: implement Stop in the mock and shadow
2016-10-25 12:08:35 -07:00
Mitchell Hashimoto
60140b28f4
Revert "Merge pull request #9536 from hashicorp/f-provider-stop"
...
This reverts commit c3a4cff133
, reversing
changes made to 791a02e6e4
.
This change requires plugin recompilation and we should hold off until a
minor release for that.
2016-10-25 12:00:36 -07:00
Mitchell Hashimoto
7e2582c47b
terraform: implement Stop in the mock and shadow
2016-10-25 11:31:55 -07: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
fa25a3051b
terraform: orphan resources in old graph need unique ID
2016-10-19 15:05:38 -07:00
Mitchell Hashimoto
d87bdc2d2b
terraform: update destroy resource with proper unique-ifier for shadow
...
This adds a proper unique extra field so that the shadow graph can
properly compare values.
2016-10-19 13:51:11 -07:00
Mitchell Hashimoto
70cee9c1c6
terraform: clean up any final TODOs with comments and placeholders
2016-10-12 19:03:41 +08:00
Mitchell Hashimoto
9a876f65ba
terraform: compare diffs on shadow Apply
2016-10-12 19:01:02 +08:00
Mitchell Hashimoto
98fa7d92a4
terraform: support data source apply for shadows
2016-10-12 18:56:57 +08:00
Mitchell Hashimoto
a9f1166583
terraform: use KeyedValue.Init to avoid initialization race
...
There were races with ValidateResource in the provider initializing the
data which resulting in lost data for the shadow. A new "Init" function
has been added to the shadow structs to support safe concurrent
initialization.
2016-10-12 18:47:52 +08:00
Mitchell Hashimoto
b0801bf125
terraform: ResourceProvider.ReadDataDiff (shadow)
2016-10-11 22:17:31 +08:00
Mitchell Hashimoto
c2dd9a7338
terraform: Provier.Diff (shadow) deep copy the config before call
2016-10-11 22:17:31 +08:00
Mitchell Hashimoto
817979c56d
terraform: ResourceProvider.ValidateResource (shadow) config deep copy
2016-10-11 22:17:31 +08:00
Mitchell Hashimoto
d7a5cc5b35
terraform: InstanceInfo.uniqueId
...
This adds a new function to get a unique identifier scoped to the graph
walk in order to identify operations against the same instance. This is
used by the shadow to namespace provider function calls.
2016-10-11 22:17:30 +08:00
Mitchell Hashimoto
a014b098b0
terraform: copy the provider input configs for the shadow context
2016-10-11 22:17:30 +08:00
Mitchell Hashimoto
fdeb4656c9
terraform: deep copy shadow arguments to avoid state modifications
...
The arguments passed into Apply, Refresh, Diff could be modified which
caused the shadow comparison later to cause errors. Also, the result
should be deep copied so that it isn't modified.
2016-10-11 22:17:30 +08:00
Mitchell Hashimoto
24456c042a
terraform: ResourceProvider (shadow) ValidateResource
2016-10-11 22:17:30 +08:00
Mitchell Hashimoto
3edb8599b1
terraform: Shadow interface, properly string through errors at the right
...
time
2016-10-11 22:17:29 +08:00
Mitchell Hashimoto
184b4a8b09
terraform: context verifies real and shadow state/diff match
2016-10-11 22:17:29 +08:00
Mitchell Hashimoto
62162427f4
terraform: ResourceProvider (shadow) CloseShadow closes all shadow
...
values
2016-10-11 22:17:29 +08:00
Mitchell Hashimoto
51ac3c5969
terraform: ResourceProvider.Refresh (shadow)
2016-10-11 22:17:28 +08:00
Mitchell Hashimoto
82a1158f55
terraform: ResourceProvider.Diff shadow
2016-10-11 22:17:28 +08:00
Mitchell Hashimoto
cbbd492bce
terraform: shadow resource provider Apply
2016-10-11 22:17:27 +08:00
Mitchell Hashimoto
3522b07b75
terraform: Shadow resource provider Configure
2016-10-11 22:17:27 +08:00
Mitchell Hashimoto
23204d2414
terraform: ResourceProvider.Validate for shadow
2016-10-11 22:17:27 +08:00
Mitchell Hashimoto
bb5f116cec
terraform: shadow resource provider tests begin
2016-10-11 22:17:27 +08:00
Mitchell Hashimoto
f73dc844c7
wip
2016-10-11 22:17:27 +08:00
Mitchell Hashimoto
1df3bbdc37
terraform: working on the resource provider shadow, not working yet
2016-10-11 22:17:27 +08:00