Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
internal/fwserver: Use existing data instead of path-based lookups du…
…ring plan modification (hashicorp#468) Reference: hashicorp#293 This change is a major rewrite of the plan modification logic to move away from globally mutating the schema response to instead localize handling of each attribute/block. The logic still transverses downward in the schema while updated plan modifier values are passed up the call stack to eventually overwrite the top level attribute/block data. The main benefit of this logic is that it cannot lose track of which element to update within a set and may have some nominal performance improvements. The majority of the logic changes are convincing the plan modification process that nested attributes and blocks have specific types for their data, which allows it to safely traverse deeper based on the schema definition. There is just a lot of repeated diagnostics handling. The new `TestAttributeModifyPlan/attribute-set-nested-usestateforunknown` and `TestBlockModifyPlan/block-set-nested-usestateforunknown` unit test cases specifically test a similar issue to the linked one where sets previously could not properly use `resource.UseStateForKnown()` for set nested attributes or set blocks.
- Loading branch information