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:
parent
f52a6630f5
commit
7b67105407
|
@ -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(
|
||||
|
|
Loading…
Reference in New Issue