diff --git a/terraform/transform_destroy_cbd.go b/terraform/transform_destroy_cbd.go index 570b2ba54..2f4d5edeb 100644 --- a/terraform/transform_destroy_cbd.go +++ b/terraform/transform_destroy_cbd.go @@ -59,11 +59,11 @@ func (t *ForcedCBDTransformer) Transform(g *Graph) error { // If there are no CBD decendent (dependent nodes), then we // do nothing here. if !t.hasCBDDescendent(g, v) { - log.Printf("[TRACE] ForcedCBDTransformer: %q (%T) has no CBD ancestors, so skipping", dag.VertexName(v), v) + log.Printf("[TRACE] ForcedCBDTransformer: %q (%T) has no CBD descendent, so skipping", dag.VertexName(v), v) continue } - // If this isn't naturally a CBD node, this means that an ancestor is + // If this isn't naturally a CBD node, this means that an descendent is // and we need to auto-upgrade this node to CBD. We do this because // a CBD node depending on non-CBD will result in cycles. To avoid this, // we always attempt to upgrade it. @@ -82,7 +82,7 @@ func (t *ForcedCBDTransformer) Transform(g *Graph) error { return nil } -// hasCBDAncestor returns true if any ancestor (node that depends on this) +// hasCBDDescendent returns true if any descendent (node that depends on this) // has CBD set. func (t *ForcedCBDTransformer) hasCBDDescendent(g *Graph, v dag.Vertex) bool { s, _ := g.Descendents(v) diff --git a/terraform/transform_destroy_cbd_test.go b/terraform/transform_destroy_cbd_test.go index 5a830fe1f..665d81647 100644 --- a/terraform/transform_destroy_cbd_test.go +++ b/terraform/transform_destroy_cbd_test.go @@ -42,6 +42,10 @@ func TestCBDEdgeTransformer(t *testing.T) { } } +// FIXME: see if there is a worthwhile test to create from this. +// CBD is marked on created nodes during the plan phase now, and the +// CBDEdgeTransformer only takes care of the final edge reversal. +/* func TestCBDEdgeTransformer_depNonCBD(t *testing.T) { g := Graph{Path: addrs.RootModuleInstance} g.Add(&graphNodeCreatorTest{AddrString: "test_object.A"}) @@ -77,6 +81,7 @@ func TestCBDEdgeTransformer_depNonCBD(t *testing.T) { t.Fatalf("wrong result\n\ngot:\n%s\n\nwant:\n%s", actual, expected) } } +*/ func TestCBDEdgeTransformer_depNonCBDCount(t *testing.T) { g := Graph{Path: addrs.RootModuleInstance}