From 8d302c5bd2a34272e9d1c4f9cca968a6b0ba1396 Mon Sep 17 00:00:00 2001 From: James Bardin Date: Tue, 22 Jan 2019 17:19:05 -0500 Subject: [PATCH] update grpc_provider for new diffs Keep the diff as-is before applying. --- helper/plugin/grpc_provider.go | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/helper/plugin/grpc_provider.go b/helper/plugin/grpc_provider.go index 46c44ca8c..9f51b8374 100644 --- a/helper/plugin/grpc_provider.go +++ b/helper/plugin/grpc_provider.go @@ -513,16 +513,6 @@ func (s *GRPCProviderServer) PlanResourceChange(_ context.Context, req *proto.Pl return resp, nil } - if diff != nil { - // strip out non-diffs - for k, v := range diff.Attributes { - if v.New == v.Old && !v.NewComputed { - delete(diff.Attributes, k) - } - } - - } - if diff == nil || len(diff.Attributes) == 0 { // schema.Provider.Diff returns nil if it ends up making a diff with no // changes, but our new interface wants us to return an actual change @@ -950,6 +940,8 @@ func normalizeFlatmapContainers(prior map[string]string, attrs map[string]string // schema. if isCount(k) && v == "1" { ones[k] = true + // make sure we don't have the same key under both categories. + delete(zeros, k) } }