diff --git a/helper/schema/grpc_provider.go b/helper/schema/grpc_provider.go index 9043cce94f..cc4a9ec445 100644 --- a/helper/schema/grpc_provider.go +++ b/helper/schema/grpc_provider.go @@ -796,10 +796,7 @@ func (s *GRPCProviderServer) PlanResourceChange(ctx context.Context, req *tfprot newExtra := map[string]interface{}{} for k, v := range diff.Attributes { - if v == nil { - log.Printf("[WARN] Field %q was null, not modifying its NewExtra", k) - continue - } + log.Printf("[TRACE] tpg-7934: copying over attribute %q", k) if v.NewExtra != nil { newExtra[k] = v.NewExtra } diff --git a/helper/schema/resource_diff.go b/helper/schema/resource_diff.go index 984929df7b..521c58768d 100644 --- a/helper/schema/resource_diff.go +++ b/helper/schema/resource_diff.go @@ -3,6 +3,7 @@ package schema import ( "errors" "fmt" + "log" "reflect" "strings" "sync" @@ -461,9 +462,11 @@ func (d *ResourceDiff) getChange(key string) (getResult, getResult, bool) { var new getResult for p := range d.updatedKeys { if childAddrOf(key, p) { + log.Printf("[TRACE] tpg-7934: key %q is child of parent %q, counts as computed", key, p) new = d.getExact(strings.Split(key, "."), "newDiff") return old, new, true } + log.Printf("[TRACE] tpg-7934: key %q is not child of parent %q, does not count as computed", key, p) } new = d.get(strings.Split(key, "."), "newDiff") return old, new, false diff --git a/helper/schema/schema.go b/helper/schema/schema.go index f3df1bb4ee..2254cac4a6 100644 --- a/helper/schema/schema.go +++ b/helper/schema/schema.go @@ -360,6 +360,7 @@ func (s *Schema) ZeroValue() interface{} { func (s *Schema) finalizeDiff(d *terraform.ResourceAttrDiff, customized bool) *terraform.ResourceAttrDiff { if d == nil { + log.Println("[TRACE] tpg-7934: returning nil from finalizeDiff because nil was passed in") return d } @@ -408,6 +409,7 @@ func (s *Schema) finalizeDiff(d *terraform.ResourceAttrDiff, customized bool) *t if d.Old != "" && d.New == "" { // This is a computed value with an old value set already, // just let it go. + log.Println("[TRACE] tpg-7934: returning nil from finalizeDiff because customized") return nil } } @@ -1383,6 +1385,7 @@ func (m schemaMap) diffString( return nil } + log.Printf("[TRACE] tpg-7934: setting attribute %q", k) diff.Attributes[k] = schema.finalizeDiff( &terraform.ResourceAttrDiff{ Old: os,