From 5731703de57443a4bdf72e9a176fa14053b6903e Mon Sep 17 00:00:00 2001 From: Martin Atkins Date: Mon, 27 Aug 2018 15:20:41 -0700 Subject: [PATCH] command/format: show planned changes in rendered plan This codepath is going to be significantly changed before release to make it support structural diff of the new data types, but this lets us lean on the old renderer to produce partial output in the mean time while we continue to work on getting things working end-to-end after the considerable refactoring that's been going on. --- command/format/plan.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/command/format/plan.go b/command/format/plan.go index 7b333017c..a2a49c303 100644 --- a/command/format/plan.go +++ b/command/format/plan.go @@ -3,6 +3,7 @@ package format import ( "bytes" "fmt" + "log" "sort" "strings" @@ -63,6 +64,7 @@ type PlanStats struct { // NewPlan produces a display-oriented Plan from a terraform.Plan. func NewPlan(changes *plans.Changes) *Plan { + log.Printf("[TRACE] NewPlan for %#v", changes) ret := &Plan{} if changes == nil { // Nothing to do! @@ -71,6 +73,7 @@ func NewPlan(changes *plans.Changes) *Plan { for _, rc := range changes.Resources { addr := rc.Addr + log.Printf("[TRACE] NewPlan found %s", addr) dataSource := addr.Resource.Resource.Mode == addrs.DataResourceMode // We create "delete" actions for data resources so we can clean @@ -119,6 +122,8 @@ func NewPlan(changes *plans.Changes) *Plan { // don't include any attributes here. // FIXME: Implement the structural diff renderer to replace this // codepath altogether. + + ret.Resources = append(ret.Resources, did) } // Sort the instance diffs by their addresses for display.