Commit Graph

918 Commits

Author SHA1 Message Date
Radek Simko
40b04154fe Add operation walkDestroy 2015-10-03 14:16:40 -07:00
Radek Simko
2b60d0c6b6 Add repro test case for bug #2892 2015-10-03 14:16:39 -07:00
Paul Hinze
c39fdd2917 Merge pull request #2988 from hashicorp/b-input-var-partially-computed
core: don't error on computed value during input walk
2015-09-24 15:07:49 -05:00
Anthony Scalisi
198e1a5186 remove various typos 2015-09-11 11:56:20 -07:00
Radek Simko
91d750d2df interpolate: Expand computed TypeList attributes properly 2015-08-27 13:02:02 +01:00
Paul Hinze
c618132085 tests: fix missed test update from last merge 2015-08-13 10:11:12 -05:00
Paul Hinze
22ea3d693f update prevent_destroy error message
per recommendations by @nathanielks

closes #2473
2015-08-13 09:57:52 -05:00
Paul Hinze
b928777cac core: don't error on computed value during input walk
fixes #2987
2015-08-12 14:23:33 -05:00
Clint Shryock
58d8ae8b51 release: cleanup after v0.6.3 2015-08-11 11:42:54 -05:00
Clint Shryock
234f49a2c9 v0.6.3 2015-08-11 15:45:58 +00:00
Paul Hinze
52c4bfbe98 core: fix deadlock when dependable node replaced with non-dependable one
In #2884, Terraform would hang on graphs with an orphaned resource
depended on an orphaned module.

This is because orphan module nodes (which are dependable) were getting
expanded (replaced) with GraphNodeBasicSubgraph nodes (which are _not_
dependable).

The old `graph.Replace()` code resulted in GraphNodeBasicSubgraph being
entered into the lookaside table, even though it is not dependable.

This resulted in an untraversable edge in the graph, so the graph would
hang and wait forever.

Now, we remove entries from the lookaside table when a dependable node
is being replaced with a non-dependable node. This means we lose an
edge, but we can move forward. It's ~probably~ never correct to be
replacing depenable nodes with non-dependable ones, but this tweak
seemed preferable to tossing a panic in there.
2015-08-10 15:50:36 -05:00
Paul Hinze
7a464b1156 tests: extract deadlock checking test helper 2015-08-10 15:50:36 -05:00
Clint Shryock
fd2b943c9d release: clean up after v0.6.2 2015-08-06 14:35:18 -05:00
Clint Shryock
f26d2b75c8 v0.6.2 2015-08-06 18:59:05 +00:00
Paul Hinze
5ebbda3334 core: fix crash on provider warning
When a provider validation only returns a warning, we were cutting the
evaltree short by returning an error. This is fine during a
`walkValidate` but was causing trouble during `walkPlan` and
`walkApply`.

fixes #2870
2015-07-28 17:13:14 -05:00
Radek Simko
a22dc2a9a2 Add resource ID to refresh errors 2015-07-22 14:09:39 +02:00
Radek Simko
8e477b78d8 Add resource ID to errors coming from apply 2015-07-22 14:09:34 +02:00
Clint Shryock
7110364298 release: clean up after v0.6.1 2015-07-20 16:03:53 -05:00
Clint Shryock
4c67368dd8 v0.6.1 2015-07-20 20:03:29 +00:00
Mitchell Hashimoto
8d29f274c8 terraform: remove print 2015-07-20 08:57:35 -07:00
Mitchell Hashimoto
696d5ef94f terraform: clarify comment 2015-07-20 08:57:35 -07:00
Mitchell Hashimoto
4d361c839e terraform: prune resources and variables 2015-07-20 08:57:34 -07:00
Mitchell Hashimoto
6550f564bf terraform: PruneNoopTransformer 2015-07-20 08:57:34 -07:00
Mitchell Hashimoto
853f4f2385 Merge pull request #2786 from hashicorp/b-nested-module-orphans
Grandchild module orphans should be destroyed
2015-07-20 08:52:33 -07:00
Mitchell Hashimoto
955bbbba41 terraform: state module orphans should only return direct 2015-07-20 08:41:24 -07:00
Paul Hinze
392f56101c core: add failing deeply nested orphan module test
I was worried about the implications of deeply nested orphaned modules
in the parent commit, so I added a test. It's failing but not quite like
I expected it to. Perhaps I've uncovered an unrelated bug here?

/cc @mitchellh
2015-07-20 10:19:52 -05:00
Mitchell Hashimoto
7735847579 terraform: splatting with computed values is computed [GH-2744] 2015-07-19 17:27:38 -07:00
Mitchell Hashimoto
edd05f2aa2 terraform: fix some test failures 2015-07-19 14:14:05 -07:00
Mitchell Hashimoto
61d275f475 terraform: get nested oprhans in the transform 2015-07-19 13:53:31 -07:00
Mitchell Hashimoto
96a04c16f6 terraform: state ModuleOrphans should return grandchild orphans 2015-07-19 13:41:57 -07:00
Mitchell Hashimoto
2ee46eda94 test case 2015-07-17 10:58:47 -07:00
Paul Hinze
f97c635ef6 core: fix "provider ... couldn't be found" bug
The `CloseProviderTransformer` relies on the `ProvidedBy()` interface to
look up the proper dependency for the the graph nodes it adds. This
interface needs to yield the name of a provider, _AND_ for flattened
nodes it needs to yield the full path to a provider.

Destroy nodes did not implement this second part, which resulted in
"provider X couldn't be found" when both of these were true:

 * A module included a resource that dependend on a provider
 * The root did _NOT_ include a provider config

Implementing a proper ProvidedBy() on the flattened version of
destroy nodes solves the issue.

fixes #2581
2015-07-16 11:56:58 -05:00
Paul Hinze
ff45f6451d core: split context tests
The context_test file has gotten pretty unruly. Let's split it up into
a few files so we can be nicer to our editors and our own sanity.

Definitely lots more we can do to clean up, but with changes like this
I'd rather do small, focused, clear steps instead of one big "cleaned up
lots of stuff" PR.
2015-07-10 14:08:49 -06:00
Sander van Harmelen
4a8ef78d33 Fixes #2676 by prefixing all Windows commands
By prefixing them with `cmd /c` it will work with both `winner` and
`ssh` connection types.

This PR also reverts some bad stringer changes made in PR #2673
2015-07-10 12:56:27 +02:00
Sander van Harmelen
97fd4f5b7d Tweaking the tests 2015-07-09 21:29:27 +02:00
Paul Hinze
5c38456b05 core: don't prompt for variables with defaults
In `helper/schema` we already makes a distinction between `Default`
which is always applied and `InputDefault` which is displayed to the
user for an empty field.

But for variables we just have `Default` which is treated like
`InputDefault`. This changes it to _not_ prompt the user for a value
when the variable declaration includes a default.

Treating this as a UX bugfix and the "don't prompt for variables w/
defaults set" behavior as the originally expected behavior we were
failing to honor.

Added an already-passing test to verify and cover the `helper/schema`
behavior.

Perhaps down the road we can add a `input_default` attribute to
variables to allow similar behavior to `helper/schema` in variables, but
for now just sticking with the fix.

Fixes #2592
2015-07-02 10:40:30 -05:00
Paul Hinze
3d81d83d01 release: clean up after 0.6.0 2015-06-30 17:39:32 -05:00
Paul Hinze
e40127fda6 v0.6.0 2015-06-30 19:57:29 +00:00
Paul Hinze
6bbf61ae6e Merge pull request #2555 from hashicorp/b-target-after-flatten
core: move targets transform after flatten
2015-06-29 13:34:52 -05:00
Paul Hinze
cf432b3ceb core: move targets transform after flatten
Allows target dependencies to be properly calculated across module
boundaries, fixing scenarios where a target depends on something inside
a module, but the contents of the module are not included in the
targeted resources.

fixes #1858
2015-06-29 13:19:37 -05:00
Paul Hinze
184edbefcd core: remove now-unused flatten impls of close nodes
/cc @mitchellh
2015-06-29 12:46:24 -05:00
Paul Hinze
557b299c4b core: move close transforms after flatten and destroy transforms
fixes destroy-related failures introduced by the close transforms
2015-06-29 12:46:18 -05:00
Mitchell Hashimoto
d6f7261190 terraform: provider mock should close itself to find bugs 2015-06-29 10:33:37 -07:00
Paul Hinze
00a177cd99 provider/aws: add test for provider aliases
Not sure if this test has value /cc @mitchellh (who requested one be
added) to see what I might be missing here.

refs #2495
2015-06-29 11:35:02 -05:00
Paul Hinze
2d6a8c1f39 core: fix provider/close provider race when targeting
When targeting prunes out all the resource nodes between a provider and
its close node, there was no dependency to ensure the close happened
after the configure. Needed to add an explicit dependency from the close
to the provider.

This tweak highlighted the fact that CloseProviderTransformer needed to
happen after DisableProviderTransformer, since
DisableProviderTransformer inspects up-edges to decide what to disable,
and CloseProviderTransformer adds an up-edge.

fixes #2495
2015-06-29 11:22:51 -05:00
Paul Hinze
2626c179a5 core: improve debug logging when targeting 2015-06-26 14:04:58 -05:00
Mitchell Hashimoto
51a7e05f8a terraform: all providers for ProvidedBy() should be added 2015-06-26 12:00:02 -07:00
Mitchell Hashimoto
7daf13487f Merge pull request #2506 from hashicorp/b-orphan-hook
terraform: orphans should call post-apply hook [GH-1938]
2015-06-26 08:19:16 -07:00
Paul Hinze
a81cad3672 Merge pull request #2504 from hashicorp/f-string-list
core: Change string list representation so we can distinguish empty, single element lists
2015-06-26 08:41:38 -05:00
Mitchell Hashimoto
8ebdc1e786 terraform: orphans should call post-apply hook [GH-1938] 2015-06-25 20:11:29 -07:00