12572e97bc
If an instance object in state has an earlier schema version number then it is likely that the schema we're holding won't be able to decode the raw data that is stored. Instead, we must ask the provider to upgrade it for us first, which might also include translating it from flatmap form if it was last updated with a Terraform version earlier than v0.12. This ends up being a "seam" between our use of int64 for schema versions in the providers package and uint64 everywhere else. We intend to standardize on int64 everywhere eventually, but for now this remains consistent with existing usage in each layer to keep the type conversion noise contained here and avoid mass-updates to other Terraform components at this time. This also includes a minor change to the test helpers for the backend/local package, which were inexplicably setting a SchemaVersion of 1 on the basic test state but setting the mock schema version to zero, creating an invalid situation where the state would need to be downgraded. |
||
---|---|---|
.. | ||
statefile | ||
statemgr | ||
doc.go | ||
eachmode_string.go | ||
instance_generation.go | ||
instance_object.go | ||
instance_object_src.go | ||
module.go | ||
objectstatus_string.go | ||
output_value.go | ||
resource.go | ||
resource_test.go | ||
state.go | ||
state_deepcopy.go | ||
state_equal.go | ||
state_filter.go | ||
state_filter_test.go | ||
state_string.go | ||
state_test.go | ||
sync.go |