prevent an empty string from being lost#21806
Conversation
apparentlymart
left a comment
There was a problem hiding this comment.
I feel like I've lost enough context in the intervening weeks to not be able to fully reason about what this is gonna do, but I trust that you have more context loaded and have thought this through, and so my review here focused on "does this code look like it does what it was intending to do". 😀
The helper/schema diff process loses empty strings, causing them to show up as unset (null) during apply. Besides failing to show as set by GetOk, the absence of the value also triggers the schema to insert a default value again during apply. It would also be be preferable if the defaults weren't re-evaluated again during ApplyResourceChange, but that would require a more invasive patch to the field readers, and ensuring the empty string is stored in the plan should block the default.
0b23912 to
4dcda04
Compare
|
Forgot the unit test for that change. |
|
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
The helper/schema diff process loses empty strings, causing them to show
up as unset (null) during apply. Besides failing to show as set by
GetOk, the absence of the value also triggers the schema to insert a
default value again during apply.
It would also be be preferable if the defaults weren't re-evaluated
again during ApplyResourceChange, but that would require a more invasive
patch to the field readers, and ensuring the empty string is stored in
the plan should block the default.
Fixes #21760