Commit Graph

8 Commits

Author SHA1 Message Date
James Bardin 3df3b99276 Make sure each GraphBuilder has a Name
Ensure that each instance of BasucGraphBuilder gets a name corresponding
to the Builder which created it. This allows us to differentiate the
graphs in the logs.
2016-11-15 16:40:10 -05:00
Mitchell Hashimoto b68b95dad0
terraform: destroy graph must connect edges for proper target ordering
This connects the destroy edges so that when a `-target` is specified on
a destroy, the proper dependencies get destroyed as well.
2016-11-10 21:14:44 -08: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 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 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