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
0cca4fc093
terraform: Context.Stop() calls Stop on providers if running
2016-10-25 11:31:55 -07:00
Mitchell Hashimoto
7e2582c47b
terraform: implement Stop in the mock and shadow
2016-10-25 11:31:55 -07:00
Mitchell Hashimoto
2be72cfe03
terraform: Stop API added to ResourceProvider
2016-10-25 11:31:55 -07:00
Mitchell Hashimoto
791a02e6e4
terraform: test that depends_on is used for destroy ordering
2016-10-25 11:05:48 -07:00
Mitchell Hashimoto
eb20db92cf
terraform: test that data sources can reference other data sources
2016-10-23 18:53:00 -07:00
Mitchell Hashimoto
1486da91ab
Missed a spot where panic: could still happen
2016-10-23 14:29:15 -07:00
Mitchell Hashimoto
0c3161083c
update CHANGELOG
2016-10-23 14:28:08 -07:00
Mitchell Hashimoto
83b1c82e93
terraform: put quotes before vertex name to avoid false panicwrap
...
Fixes #9395
2016-10-23 14:23:36 -07:00
Mitchell Hashimoto
5a8ec482a2
terraform: unify destroy/apply graph builders
...
They're so similar we unify them, they only change in a select few
places. This is very similar to the old graph but is still much simpler.
2016-10-22 12:12:30 -07:00
Mitchell Hashimoto
1523504645
terraform: enable shadow graph and destroy resource mode with addr
...
This enables the shadow graph since all tests pass!
We also change the destroy node to check the resource type using the
addr since that is always available and reliable. The configuration can
be nil for orphans.
2016-10-22 12:12:30 -07:00
Mitchell Hashimoto
a4aea3e085
terraform: destroy apply graph builder should disable providers
2016-10-22 12:12:30 -07:00
Mitchell Hashimoto
db6d87b16c
terraform: destroy node should understand data sources
...
This makes the new destroy nodes undestand data sourcs and call the
correct apply function.
2016-10-22 12:12:30 -07:00
Mitchell Hashimoto
ac9a049d19
terraform: Diff.Equal ignores ModuleDiff.Destroy
...
This is necessary to get the shadow working properly with the destroy
graph since the destroy graph doesn't set this field but the end state
is still the same.
2016-10-22 12:12:30 -07:00
Mitchell Hashimoto
ceb613d449
terraform: don't set destroy module on diff
...
This is something that should be determined and done during an apply. It
doesn't make a lot of sense that the plan is doing it (in its current
form at least).
2016-10-22 12:12:30 -07:00
Mitchell Hashimoto
ab4ebcc5c7
terraform: TargetsTransformer on destroy plan
...
This enables targeting to work properly on planning destroys
2016-10-22 12:12:30 -07:00
Mitchell Hashimoto
2d4f65cc94
terraform: disable shadowing destroy graph for now
...
It doesn't fully work so we want to wait until we think its ready before
we start the shadowing.
2016-10-22 12:12:29 -07:00
Mitchell Hashimoto
480a414c40
terraform: destroy module nodes show up in plan destroy
2016-10-22 12:12:29 -07:00
Mitchell Hashimoto
e68327e765
terraform: add config transformer to enable preventDestroy
2016-10-22 12:12:29 -07:00
Mitchell Hashimoto
0ed896a313
terraform: implement destroy planning basics from state
2016-10-22 12:12:29 -07:00
Mitchell Hashimoto
db807f4b0f
terraform: destroy graph builder, -Xnew-destroy flag
2016-10-22 12:12:29 -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
f8e35ecb2f
terraform: log starting graph walk outside of the goroutine
...
This is so ordering makes a bit more sense reliably.
2016-10-21 16:20:38 -07:00
Mitchell Hashimoto
ae4f79e3b6
command/meta: add -shadow flag to disable shadow graph
...
Since it is still very much possible for this to cause problems, this
can be used to disable the shadow graph. We'll purposely not document
this since the goal is to remove this flag as we become more confident
with it.
2016-10-21 14:25:05 -07:00
Mitchell Hashimoto
4a6cc3b100
terraform: new apply resource node supports data sources
...
This enables the new apply graph's resource node to apply data sources.
Data sources appear to only be tested for "refresh" which is likely
where they're set but they've also been implemented (not my code, not
trying to edit code) within the "apply" operation as well.
This adds an apply test to ensure data sources work, and then modifies
the new apply node to support data sources.
2016-10-20 22:03:48 -07:00
Mitchell Hashimoto
1d27e554a5
terraform: test to ensure data sources work on Apply operation
...
It appears data sources have always been coded to work during apply, as
can be verified with this test (no impl. changes were necessary to make
it pass).
This test should be added to ensure our apply graph always works with
data sources as well.
2016-10-20 21:53:54 -07:00
Mitchell Hashimoto
2c1a21a8ef
terraform: disable shadowing the experimental graph
2016-10-20 15:17:28 -07:00
Mitchell Hashimoto
a89dcfd1b1
terraform: re-enable shadow tests
2016-10-19 15:09:01 -07:00
Mitchell Hashimoto
51e90cd641
terraform: move references for disable provider transform to old
2016-10-19 15:07:00 -07:00
Mitchell Hashimoto
fa25a3051b
terraform: orphan resources in old graph need unique ID
2016-10-19 15:05:38 -07:00
Mitchell Hashimoto
d27c8fbbbc
terraform: compared states from shadow graph must be pruned
2016-10-19 15:01:54 -07:00
Mitchell Hashimoto
e4ef1fe553
terraform: disable providers in new apply graph
...
This adds the proper logic for "disabling" providers to the new apply
graph: interolating and storing the config for inheritance but not
actually initializing and configuring the provider.
This is important since parent modules will often contain incomplete
provider configurations for the purpose of inheritance that would error
if they were actually attempted to be configured (since they're
incomplete). If the provider is not used, it should be "disabled".
2016-10-19 14:54:00 -07:00
Mitchell Hashimoto
13b9007474
terraform: logic for shadowing the original graph
...
This introduces failing tests. How many is unknown since shadow graph
errors cause a panic.
2016-10-19 14:17:12 -07:00
Mitchell Hashimoto
7d36e991da
terraform: resource address internal can parse data resource addrs
2016-10-19 14:12:30 -07:00
Mitchell Hashimoto
5d598ad217
terraform: if components is closed, initialize closed components
...
This was happening if the shadow initializes a provider that is never
used by the real side. We need to make sure it starts closed.
2016-10-19 14:10:46 -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
c9c1912b34
terraform: missing fields from ApplyGraphBuilder after master rebase
2016-10-19 13:46:32 -07:00
Mitchell Hashimoto
e59efa024b
terraform: fix merge issues with master
2016-10-19 13:41:30 -07:00
Mitchell Hashimoto
ec15783f24
-Xnew-apply to enable the new apply graph
2016-10-19 13:39:28 -07:00
Mitchell Hashimoto
eb9ecea863
terraform: don't set Provider on destroy nodes
...
This doesn't explicitly set `rs.Provider` on destroy nodes.
To be honest, I'm not sure why this was done in the first place (git
blame points to 6fda7bb5483a155b8ae1e1e4e4b7b7c4073bc1d9). Tests always
passed without it, and by adding it it causes other tests to fail. I
should've never changed those other tests.
Removing it now to get tests passing, this also reverts the test changes
made in 8213824962f085279810f04b60b95d1176a3a3f2.
2016-10-19 13:39:13 -07:00
Mitchell Hashimoto
7c2c9b82a3
terraform: interpolation for multi-var checks both ".0" and "" suffix
2016-10-19 13:39:13 -07:00
Mitchell Hashimoto
9ac4ee4b52
terraform: transform module variables does parent first
2016-10-19 13:38:53 -07:00
Mitchell Hashimoto
924f7a49e0
terraform: module variable transform must do children later (tested)
2016-10-19 13:38:53 -07:00
Mitchell Hashimoto
c1664d2eaa
terraform: cbd works!
2016-10-19 13:38:53 -07:00
Mitchell Hashimoto
23665790f3
terraform: destroy resource should have no references
2016-10-19 13:38:53 -07:00
Mitchell Hashimoto
aaee4df363
terraform: working on enabling CBD, some cycles
2016-10-19 13:38:53 -07:00
Mitchell Hashimoto
4aa84a2071
terraform: CBD makes the proper edge connections for dependent resources
2016-10-19 13:38:53 -07:00
Mitchell Hashimoto
3d4937b784
terraform: FlatConfigTransformer
2016-10-19 13:38:53 -07:00
Mitchell Hashimoto
6622ca001d
terraform: abstract resource nodes
2016-10-19 13:38:53 -07:00
Mitchell Hashimoto
046faf247a
terraform: cleanup and failing test for CBD
2016-10-19 13:38:53 -07:00
Mitchell Hashimoto
4e8e6cd661
dag: add EdgesFrom, EdgesTo, needs tests
2016-10-19 13:38:53 -07:00
Mitchell Hashimoto
b9b23e8483
terraform: improved logging
2016-10-19 13:38:53 -07:00
Mitchell Hashimoto
7baf64f806
terraform: starting CBD, destroy edge for the destroy relationship
2016-10-19 13:38:52 -07:00
Mitchell Hashimoto
4988378ccb
terraform: remove diff transformer test that no longer happens
2016-10-19 13:38:52 -07:00
Mitchell Hashimoto
311d27108e
terraform: Enable DestroyEdgeTransformer
2016-10-19 13:38:52 -07:00
Mitchell Hashimoto
08dade5475
terraform: more destroy edge tests
2016-10-19 13:38:52 -07:00
Mitchell Hashimoto
7b2bd93094
terraform: test the destroy edge transform
2016-10-19 13:38:52 -07:00
Mitchell Hashimoto
bd5d97f9f5
terraform: transform to attach resource configs
2016-10-19 13:38:52 -07:00
Mitchell Hashimoto
ceb5c53d56
terraform: destroy nodes should call post state update hook
2016-10-19 13:38:52 -07:00
Mitchell Hashimoto
56b4521d8f
terraform: provider depends on config references
2016-10-19 13:38:52 -07:00
Mitchell Hashimoto
ebc7d209a7
terraform: new graph fixes ".0" and "" boundaries on counts
2016-10-19 13:38:52 -07:00
Mitchell Hashimoto
2e8cb94a5e
terraform: orphan outputs are deleted from the state
2016-10-19 13:38:52 -07:00
Mitchell Hashimoto
38b9f7794d
terraform: reference transformer shouldn't make loop to self
2016-10-19 13:38:52 -07:00
Mitchell Hashimoto
5018617049
terraform: change node name so that it shows up properly
2016-10-19 13:38:52 -07:00
Mitchell Hashimoto
cd04ccfa62
terraform: update a test to be easier to target
2016-10-19 13:38:51 -07:00
Mitchell Hashimoto
80ef7f1acf
terraform: properly compare bad diffs
2016-10-19 13:38:51 -07:00
Mitchell Hashimoto
9e8cd48cda
terraform: add destroy nodes, destroys kind of work
2016-10-19 13:38:51 -07:00
Mitchell Hashimoto
2e8a419fd8
terraform: starting work on destroy
2016-10-19 13:38:51 -07:00
Mitchell Hashimoto
dfa02e4412
terraform: rename attach config to only attach provider config
2016-10-19 13:38:51 -07:00
Mitchell Hashimoto
0e666aa575
terraform: get tests to not panic on failures
2016-10-19 13:38:51 -07:00
Mitchell Hashimoto
0463ad74a8
terraform: RootVariableTransform
2016-10-19 13:38:51 -07:00
Mitchell Hashimoto
993c29f34a
terraform: move ModuleVariableTransformer to its own file
2016-10-19 13:38:51 -07:00
Mitchell Hashimoto
0d815872e1
terraform: tests for module variable node
2016-10-19 13:38:51 -07:00
Mitchell Hashimoto
3fb83f013e
terraform: depend on parent items
2016-10-19 13:38:51 -07:00
Mitchell Hashimoto
ad03a21040
terraform: rename to ModuleVariable
2016-10-19 13:38:51 -07:00
Mitchell Hashimoto
4dfdc52ba0
terraform: first stap at module variables, going to redo some things
2016-10-19 13:38:51 -07:00
Mitchell Hashimoto
6376c4ca9b
terraform: update comment
2016-10-19 13:38:51 -07:00
Mitchell Hashimoto
f2aa880625
terraform: proper prefix for output connects
2016-10-19 13:38:50 -07:00
Mitchell Hashimoto
7d07f20893
terraform: fix references to module outputs
2016-10-19 13:38:50 -07:00
Mitchell Hashimoto
0d7674b079
terraform: apply builder adds outputs to graphs
2016-10-19 13:38:50 -07:00
Mitchell Hashimoto
ba51295267
terraform: ReferenceTransform test
2016-10-19 13:38:50 -07:00
Mitchell Hashimoto
21888b1227
terraform: test for referencetransform for modules
2016-10-19 13:38:50 -07:00
Mitchell Hashimoto
994f5ce773
terraform: ReferenceTransform to connect references
2016-10-19 13:38:50 -07:00
Mitchell Hashimoto
e9e8304e95
terraform: new output transform that isn't used yet
2016-10-19 13:38:50 -07:00
Mitchell Hashimoto
7dd4813730
terraform: rename test to be more easily targetable
2016-10-19 13:38:50 -07:00
Mitchell Hashimoto
5220cba77c
terraform: enable provisioners to execute
2016-10-19 13:38:50 -07:00
Mitchell Hashimoto
0f0eecfee7
terraform: add provisioner nodes to the apply graph
2016-10-19 13:38:50 -07:00
Mitchell Hashimoto
4033e90474
terraform: clarify commment
2016-10-19 13:38:50 -07:00
Mitchell Hashimoto
39abec4970
terraform: NodeApplyableProvider evals with config
2016-10-19 13:38:50 -07:00
Mitchell Hashimoto
79a742c1ae
terraform: new provider graph node for flattened world
2016-10-19 13:38:49 -07:00
Mitchell Hashimoto
b2ef4e9ac0
terraform: add way to toggle the graphs to use for apply
2016-10-19 13:38:49 -07:00
Mitchell Hashimoto
11578f0792
terraform: tests for ParentProviderTransformer
2016-10-19 13:38:49 -07:00
Mitchell Hashimoto
87bff933ef
terraform: ParentProviderTransform to connect parent providers
2016-10-19 13:38:49 -07:00
Mitchell Hashimoto
ba751c4e3b
terraform: comment to avoid panic
2016-10-19 13:38:49 -07:00
Mitchell Hashimoto
e784e4a434
terraform: remove more nil panics (doesn't change test logic)
2016-10-19 13:38:49 -07:00
Mitchell Hashimoto
9ea9e52185
terraform: rename Config to Module, tests for diff transform
2016-10-19 13:38:49 -07:00
Mitchell Hashimoto
dcc3eb3011
terraform: test for ResourceAddress.stateId()
2016-10-19 13:38:49 -07:00
Mitchell Hashimoto
5828a0a9ac
terraform: minimal applies work!
2016-10-19 13:38:49 -07:00
Mitchell Hashimoto
dc9b9eee44
terraform: connect providers in the apply graph
2016-10-19 13:38:49 -07:00
Mitchell Hashimoto
77b9177bd5
terraform: an incredible number of failing tests!
2016-10-19 13:38:49 -07:00