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.
This commit is contained in:
James Bardin 2019-04-03 17:37:58 -04:00
parent f52a6630f5
commit 7b67105407
1 changed files with 0 additions and 11 deletions

View File

@ -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(