Commit Graph

5 Commits

Author SHA1 Message Date
James Bardin a94f5ee132 prevent panics when encountering nil diffs
While we can't change the behavior of helper/schema at this point, we
can protect against panics in the case of unexpected nils in the
instance diff.
2019-09-04 16:51:42 -04:00
James Bardin b9e5745b3c remove SkipCoreTypeCheck and LegacySchema
Update the test provider to match the sdk.
2019-05-14 18:19:18 -04:00
Martin Atkins 861a2ebf26 helper/schema: Use a more targeted shim for nested set diff applying
We previously attempted to make the special diff apply behavior for nested
sets of objects work with attribute mode by totally discarding attribute
mode for all shims.

In practice, that is too broad a solution: there are lots of other shimming
behaviors that we _don't_ want when attribute mode is enabled. In
particular, we need to make sure that the difference between null and
empty can be seen in configuration.

As a compromise then, we will give all of the shims access to the real
ConfigMode and then do a more specialized fixup within the diff-apply
logic: we'll construct a synthetic nested block schema and then use that
to run our existing logic to deal with nested sets of objects, while
using the previous behavior in all other cases.

In effect, this means that the special new behavior only applies when the
provider uses the opt-in ConfigMode setting on a particular attribute,
and thus this change has much less risk of causing broad, unintended
regressions elsewhere.
2019-04-17 07:47:31 -07:00
James Bardin a3d58665ad use LegacyResourceSchema
rather than the previous .CoreConfigSchemaForShimming
2019-04-08 16:45:35 -04:00
James Bardin af9dacb9f9 add failing test for diff.Apply
Add a diff test using a shcema with ConfigModeAttr.

It's in the test provider, because that is what is mostly responsible
for exercising diff.Apply, and where the other tests are.
2019-04-08 16:45:06 -04:00