Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Avoid map setting in StateToTpl for the resource schema
The resource schema should be only read, but not modified in `tfadd`. The only exception is that in `StateToTpl` we modify the schema of the `id` attribute of all resources, to convert it from O+C to be C only. This is mainly for provider schemas based on SDKv2. This modification can be done by directly setting the attribute schema, or setting a new attribute schema to the `id` attribute. The latter will effectively modify the schema.Attributes map, which if is under accessed by other Go routines, will cause Go's concurrent map access panic. So this PR changes it to using the former method.
- Loading branch information