From 7b6710540795f20b7d36affd735b9b0dcd3c7520 Mon Sep 17 00:00:00 2001 From: James Bardin Date: Wed, 3 Apr 2019 17:37:58 -0400 Subject: [PATCH] don't strip new-computeds from plan diffs Stripping these was a patch for some provider behavior which was fixed in other ways, and is no longer needed. Removing this allows us to implement correct CusomizeDiffFuncs in providers so that they can mark fields with empty values as computed during a plan. --- helper/plugin/grpc_provider.go | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/helper/plugin/grpc_provider.go b/helper/plugin/grpc_provider.go index f7ace8b5a..de90d88ac 100644 --- a/helper/plugin/grpc_provider.go +++ b/helper/plugin/grpc_provider.go @@ -611,17 +611,6 @@ func (s *GRPCProviderServer) PlanResourceChange(_ context.Context, req *proto.Pl priorState = &terraform.InstanceState{} } - // if we're not creating a new resource, remove any new computed fields - if !create { - for attr, d := range diff.Attributes { - // If there's no change, then don't let this go through as NewComputed. - // This usually only happens when Old and New are both empty. - if d.NewComputed && d.Old == d.New { - delete(diff.Attributes, attr) - } - } - } - // now we need to apply the diff to the prior state, so get the planned state plannedAttrs, err := diff.Apply(priorState.Attributes, res.CoreConfigSchemaWhenShimmed()) schema.FixupAsSingleInstanceStateOut(