terraform: Mark modules for destroy
This commit is contained in:
parent
9c6280f64b
commit
d5fd4dabe8
|
@ -922,6 +922,13 @@ func (c *walkContext) planDestroyWalkFn() depgraph.WalkFunc {
|
||||||
walkFn = func(n *depgraph.Noun) error {
|
walkFn = func(n *depgraph.Noun) error {
|
||||||
switch m := n.Meta.(type) {
|
switch m := n.Meta.(type) {
|
||||||
case *GraphNodeModule:
|
case *GraphNodeModule:
|
||||||
|
// Set the destroy bool on the module
|
||||||
|
md := result.Diff.ModuleByPath(m.Path)
|
||||||
|
if md == nil {
|
||||||
|
md = result.Diff.AddModule(m.Path)
|
||||||
|
}
|
||||||
|
md.Destroy = true
|
||||||
|
|
||||||
// Build another walkContext for this module and walk it.
|
// Build another walkContext for this module and walk it.
|
||||||
wc := c.Context.walkContext(c.Operation, m.Path)
|
wc := c.Context.walkContext(c.Operation, m.Path)
|
||||||
|
|
||||||
|
|
|
@ -114,6 +114,7 @@ func (d *Diff) init() {
|
||||||
type ModuleDiff struct {
|
type ModuleDiff struct {
|
||||||
Path []string
|
Path []string
|
||||||
Resources map[string]*InstanceDiff
|
Resources map[string]*InstanceDiff
|
||||||
|
Destroy bool // Set only by the destroy plan
|
||||||
}
|
}
|
||||||
|
|
||||||
func (d *ModuleDiff) init() {
|
func (d *ModuleDiff) init() {
|
||||||
|
|
Loading…
Reference in New Issue