mirror of
https://github.com/opentofu/opentofu.git
synced 2024-12-28 18:01:01 -06:00
bd1a215580
Due to the lossiness of our legacy models for diff and state, shimming a diff and then creating a state from it produces a different result than shimming a state directly. That means that ImportStateVerify no longer works as expected if there are any Computed attributes in the schema where d.Set isn't called during Read. Fixing that for every case would require some risky changes to the shim behavior, so we're instead going to ask provider developers to address it by adding `d.Set` calls where needed, since that is the contract for "Computed" anyway -- a default value should be produced during Create, and thus by extension during Import. However, since a common situation where this occurs is attributes marked as "Removed", since all of the code that deals with them has generally been deleted, we'll avoid problems in that case here by treating Removed attributes as ignored for the purposes of ImportStateVerify. This required exporting some functionality that was formerly unexported in helper/schema, but it's a relatively harmless schema introspection function so shouldn't be a big deal to export it. |
||
---|---|---|
.. | ||
error.go | ||
grpc_test_provider.go | ||
id_test.go | ||
id.go | ||
map_test.go | ||
map.go | ||
resource.go | ||
state_shim_test.go | ||
state_shim.go | ||
state_test.go | ||
state.go | ||
testing_config.go | ||
testing_import_state_test.go | ||
testing_import_state.go | ||
testing_test.go | ||
testing.go | ||
wait_test.go | ||
wait.go |