Commit Graph

147 Commits

Author SHA1 Message Date
Mitchell Hashimoto
348cfa0ed7
terraform: remove graph annotations 2017-01-26 20:13:42 -08:00
James Bardin
bb137f4bfb Remove the dot graphs from the debug log,
and record the walk visits in the debug information.
2016-11-15 11:11:53 -05:00
James Bardin
7e66df3290 Rename annotation methods
Change AnnotateVertex and AnnotateEdge to VertexDebugInfo EdgeDebugInfo
to avoid confusion between debug output and future graph annotations.
2016-11-14 11:06:52 -05:00
James Bardin
916d3522b1 Write debug info using Graph.AnnotateVertex 2016-11-14 08:52:18 -05:00
James Bardin
6f9744292a Replace DebugGraphs with the Graph's methods
Now that the Graph can serialize itself, and log transformations,
there's no need for DebugGraph
2016-11-14 08:52:18 -05:00
James Bardin
7b774f771b implement dag.Subgrapher interface
This allows the dag package to detect subgraphs, even when impelemnted
by types from other packages
2016-11-14 08:50:34 -05:00
James Bardin
797a1b339d DebugInfo and DebugGraph
Implement debugInfo and the DebugGraph

DebugInfo will be a global variable through which graph debug
information can we written to a compressed archive. The DebugInfo
methods are all safe for concurrent use, and noop with a nil receiver.
The API outside of the terraform package will be to call SetDebugInfo
to create the archive, and CloseDebugInfo() to properly close the file.
Each write to the archive will be flushed and sync'ed individually, so
in the event of a crash or a missing call to Close, the archive can
still be recovered.

The DebugGraph is a representation of a terraform Graph to be written to
the debug archive, currently in dot format. The DebugGraph also contains
an internal buffer with Printf and Write methods to add to this buffer.
The buffer will be written to an accompanying file in the debug archive
along with the graph.

This also adds a GraphNodeDebugger interface. Any node implementing
`NodeDebug() string` can output information to annotate the debug graph
node, and add the data to the log. This interface may change or be
removed to provide richer options for debugging graph nodes.

The new graph builders all delegate the build to the BasicGraphBuilder.
Having a Name field lets us differentiate the actual builder
implementation in the debug graphs.
2016-11-04 11:30:51 -04:00
Mitchell Hashimoto
da508d6a8b
terraform: GraphWalkerPanicwrap catches panics during graph walks 2016-11-03 12:08:55 -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
c1664d2eaa
terraform: cbd works! 2016-10-19 13:38:53 -07:00
Mitchell Hashimoto
87bff933ef
terraform: ParentProviderTransform to connect parent providers 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
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
Mitchell Hashimoto
8f58367680 terraform: missing providers need to do dependencies 2015-05-01 18:08:06 -07:00
Mitchell Hashimoto
c207beda36 terraform: set variables in the proper location 2015-05-01 16:29:19 -07:00
Mitchell Hashimoto
f2e7f505d4 terraform: subpath context setting 2015-05-01 14:19:32 -07:00
Mitchell Hashimoto
7e838dfae2 terraform: Graph should overrride Remove to clear lookaside 2015-05-01 11:20:57 -07:00
Mitchell Hashimoto
e089e34c89 terraform: graph walk should handle eval errors properly 2015-02-19 12:08:02 -08:00
Mitchell Hashimoto
863b9a4f45 terraform: filter eval nodes on operation 2015-02-19 12:07:59 -08:00
Mitchell Hashimoto
d847b2b672 terraform: provider config inheritance in modules 2015-02-19 12:07:59 -08:00
Mitchell Hashimoto
cf5f26bd9a terraform: walk static subgraphs 2015-02-19 12:07:59 -08:00
Mitchell Hashimoto
b8bc3dc19b terraform: provider should be cached by path 2015-02-19 12:07:58 -08:00
Mitchell Hashimoto
cd609172e1 terraform: new dag.WalkFunc API 2015-02-19 12:07:57 -08:00
Mitchell Hashimoto
28a23a45f4 terraform: dynamic subgraph expansion for count 2015-02-19 12:07:57 -08:00
Mitchell Hashimoto
58347617e8 terraform: trying this graphwalker thing 2015-02-19 12:07:56 -08:00
Mitchell Hashimoto
012d68923c terraform: Eval 2015-02-19 12:07:55 -08:00
Mitchell Hashimoto
e1d3f308a6 terraform: untainted resource depends on tainted resource if it exists 2015-02-19 12:07:53 -08:00
Mitchell Hashimoto
8bf725e746 terraform: GraphNodeDependent 2015-02-19 12:07:53 -08:00
Mitchell Hashimoto
cb4e364aca terraform: more tests 2015-02-19 12:07:52 -08:00
Mitchell Hashimoto
4f8152c28a terraform: the orphan transform uses the graph path 2015-02-19 12:07:52 -08:00
Mitchell Hashimoto
3820aea513 terraform: make adding config nodes a transformer 2015-02-19 12:07:52 -08:00
Mitchell Hashimoto
c18825800b terraform: rename graph to graph_old*.go 2015-02-19 12:07:52 -08:00
Mitchell Hashimoto
659f0db8cf terraform: Graph => GraphOld 2015-02-19 12:07:52 -08:00
Mitchell Hashimoto
dc036a0dd0 terraform: fix bug with crash with no providers [GH-786] 2015-01-16 09:56:51 -08:00
Sander van Harmelen
528167513b Looking at issue #639 this seems to be the root cause
After fixing this part, there also needs to be made a change to the
example given or the schema of aws_elb.
2014-12-15 23:38:46 +01:00
Armon Dadgar
afef564108 terraform: Handle module depedency inversion 2014-11-24 14:38:06 -08:00
Armon Dadgar
9c6280f64b terraform: encode module dependencies 2014-11-21 16:44:20 -08:00
Armon Dadgar
ec1c026b80 terraform: initialize and attach module state 2014-11-21 16:41:48 -08:00
Armon Dadgar
6e1ef1c634 terraform: restore dependencies for orphan modules 2014-11-21 16:14:57 -08:00
Armon Dadgar
01db1ff8bd terraform: diff handler in expansion avoids duplicate destroy 2014-11-18 15:38:40 -08:00
Armon Dadgar
507b75449f terraform: Move diff handling during dynamic expansion 2014-11-18 15:10:18 -08:00
Armon Dadgar
a2ba45edf5 terraform: Simplify sub-graph finalization 2014-11-17 15:50:26 -08:00
Mitchell Hashimoto
686871310d terraform: input properly sends on only set input 2014-10-18 14:54:42 -07:00
Mitchell Hashimoto
0a5e06d62c terraform: merge interpolated inherited provider configurations [GH-418] 2014-10-18 13:58:01 -07:00
Mitchell Hashimoto
b2d674b431 terraform: don't add tainted resources to expanded graph [GH-412]
The tainted resources are separate elements in the graph.
2014-10-18 11:13:36 -07:00
Mitchell Hashimoto
06889b8fc7 terraform: make sure taint destroys happen first for counts 2014-10-12 09:50:36 -07:00
Mitchell Hashimoto
ac7e494697 terraform: remove an inaccurate TODO 2014-10-12 09:19:38 -07:00
Mitchell Hashimoto
f74a27d75f terraform: provisioner dependencies are reflected in graph 2014-10-12 09:15:26 -07:00