netascode / terraform-provider-fmc

Mozilla Public License 2.0
2 stars 7 forks source link

fix: in Create and Update never attempt to modify Known values #86

Closed jabielecki closed 1 month ago

jabielecki commented 1 month ago

Fix of a slight bug exposure. The existing updateFromBody might sometimes read a Known state value during Create or Update (only if the config item is IsNull). In this situation terraform complains loudly that this is "always a bug in provider", because we break the contract of Create or Update.

After this change, Create or Update only read unknown values.

Also, rename updateFromBody to fromBodyPartial, because it is no longer called from within Update. Keeping the old name would be probably miselading.

This is not specific to FMC in any way, this probably applies to all instances of updateFromBody idea.

(BTW: I've got a further idea, how to get rid of isNull and replace it with something lighter)