Commit Graph

15 Commits

Author SHA1 Message Date
Mitchell Hashimoto
7031cb145c terraform: orphan dependencies should be inverted 2015-06-23 20:41:02 -07:00
Sander van Harmelen
0b1dbf31a3 core: close provider/provisioner connections
Currently Terraform is leaking goroutines and with that memory. I know
strictly speaking this maybe isn’t a real concern for Terraform as it’s
mostly used as a short running command line executable.

But there are a few of us out there that are using Terraform in some
long running processes and then this starts to become a problem.

Next to that it’s of course good programming practise to clean up
resources when they're not needed anymore. So even for the standard
command line use case, this seems an improvement in resource management.

Personally I see no downsides as the primary connection to the plugin
is kept alive (the plugin is not killed) and only unused connections
that will never be used again are closed to free up any related
goroutines and memory.
2015-06-19 21:52:50 +02:00
Mitchell Hashimoto
7c3e355bb0 terraform: flattening multi-level modules works 2015-05-07 13:08:59 -07:00
Paul Hinze
d4b9362518 core: validate on verbose graph to detect some cycles earlier
Most CBD-related cycles include destroy nodes, and destroy nodes were
all being pruned from the graph before staring the Validate walk.

In practice this meant that we had scenarios that would error out with
graph cycles on Apply that _seemed_ fine during Plan.

This introduces a Verbose option to the GraphBuilder that tells it to
generate a "worst-case" graph. Validate sets this to true so that cycle
errors will always trigger at this step if they're going to happen.

(This Verbose option will be exposed as a CLI flag to `terraform graph`
in a second incoming PR.)

refs #1651
2015-04-23 11:07:13 -05:00
Mitchell Hashimoto
b64fd8401c terraform: prune tainted destroys if no tainted in state [GH-1475] 2015-04-14 10:48:45 -07:00
Mitchell Hashimoto
865de51816 dag: do a DFS for each vertex 2015-02-27 19:37:59 -08:00
Mitchell Hashimoto
9eb7ebbddd terraform: do the transitive reduction as part of the graph builder 2015-02-27 19:23:20 -08:00
Mitchell Hashimoto
ad595cf254 terraform: test case for cycle of CBD depending on non-CBD 2015-02-19 12:08:33 -08:00
Mitchell Hashimoto
e68ea0d38f terraform: only keep the destroy if we decreased counts 2015-02-19 12:08:33 -08:00
Mitchell Hashimoto
742b45886a terraform: destroy nodes work properly 2015-02-19 12:08:06 -08:00
Mitchell Hashimoto
d7dc0291f5 terraform: put destroy nodes into the graph 2015-02-19 12:08:03 -08:00
Mitchell Hashimoto
d847b2b672 terraform: provider config inheritance in modules 2015-02-19 12:07:59 -08:00
Mitchell Hashimoto
cae6deb351 terraform: more tests 2015-02-19 12:07:57 -08:00
Mitchell Hashimoto
e2a3f78c08 terraform: expand modules in our builder 2015-02-19 12:07:57 -08:00
Mitchell Hashimoto
a73f939ee9 terraform: initial GraphBuilder impl 2015-02-19 12:07:54 -08:00