terraform/builtin/providers/test
Martin Atkins ff2de9c818 core: Keep old value on error even for delete
When an operation fails, providers may return a null new value rather than
returning a partial state. In that case, we'd prefer to keep the old value
so that we stand the best chance of being able to retry on a subsequent
run.

Previously we were making an exception for the delete action, allowing
the result of that to be null even when an error is returned. In practice
that was a bad idea because it would cause Terraform to lose track of the
object even though it might not actually have been deleted.

Now we'll retain the old object even in the delete case. Providers can
still return partial new objects if they were able to partially complete
a delete operation, in which case we'll discard what we had before, but
if the result is null with errors then we'll assume the delete failed
entirely and so just keep the old state as-is, giving us the opportunity
to refresh it on the next run to see if anything actually happened after
all.

(This also includes a new resource in the test provider which isn't used
by the patch but was useful for some manual UX testing here, so I thought
I'd include it in case it's similarly useful in future, given how simple
its implementation is.)
2019-04-17 07:40:15 -07:00
..
data_source.go failing tests when using resources with count 2018-12-17 12:15:43 -05:00
data_source_label.go provider/test: allow assigning a label to each instance 2017-05-11 10:52:51 -07:00
data_source_label_test.go provider/test: allow assigning a label to each instance 2017-05-11 10:52:51 -07:00
data_source_test.go core: Specialized errors for incorrect indexes in resource reference 2018-12-20 13:55:42 -08:00
diff_apply_test.go use LegacyResourceSchema 2019-04-08 16:45:35 -04:00
provider.go core: Keep old value on error even for delete 2019-04-17 07:40:15 -07:00
provider_test.go core: Fix issues with ignore_changes 2016-03-21 14:20:36 -05:00
resource.go create a downstream failure from a computed value 2019-04-03 17:36:08 -04:00
resource_computed_set.go stop removing empty flatmap containers 2019-03-11 15:14:29 -04:00
resource_computed_set_test.go remove the partially-known ~ set sigil in diffs 2019-03-04 17:36:30 -05:00
resource_config_mode.go helper/plugin: Implement Schema.SkipCoreTypeCheck 2019-03-21 15:19:59 -07:00
resource_config_mode_test.go lang/eval: Apply attr-as-nested-block fixup in EvalBlock 2019-03-28 10:41:01 -07:00
resource_data_dep_test.go udpate test configs to work with hcl2 2018-10-16 19:14:54 -07:00
resource_dataproc_cluster_test.go add test for complex schema diff apply 2019-03-12 12:04:35 -04:00
resource_defaults.go add tests for nested default values 2019-01-17 18:51:18 -05:00
resource_defaults_test.go add more tests 2019-01-23 20:03:10 -05:00
resource_deprecated.go add tests for deprecated/removed attrs 2019-01-12 10:41:04 -05:00
resource_deprecated_test.go add tests for deprecated/removed attrs 2019-01-12 10:41:04 -05:00
resource_diff_suppress.go computed value wasn't being set 2018-11-27 08:54:15 -05:00
resource_diff_suppress_test.go verify DiffSuppresFunc behavior 2018-11-16 11:17:23 -05:00
resource_force_new.go add provider tests for force-new with a map 2018-10-31 13:42:28 -04:00
resource_force_new_test.go add provider tests for force-new with a map 2018-10-31 13:42:28 -04:00
resource_gh12183.go helper/schema: Opt-in panic on invalid ResourceData.Set 2017-11-08 10:05:11 +00:00
resource_gh12183_test.go udpate test configs to work with hcl2 2018-10-16 19:14:54 -07:00
resource_import_other.go plugin: Use correct schema when marshaling imported resource objects 2019-02-01 15:22:54 -08:00
resource_import_other_test.go plugin: Use correct schema when marshaling imported resource objects 2019-02-01 15:22:54 -08:00
resource_import_removed.go helper/resource: Ignore Removed attributes for ImportStateVerify 2019-04-16 11:14:49 -07:00
resource_import_removed_test.go helper/resource: Ignore Removed attributes for ImportStateVerify 2019-04-16 11:14:49 -07:00
resource_list.go add test provider coverage around unknown vals 2019-03-29 13:56:42 -04:00
resource_list_set.go add a trouble test schema from the aws provider 2019-02-13 19:09:46 -05:00
resource_list_set_test.go add a trouble test schema from the aws provider 2019-02-13 19:09:46 -05:00
resource_list_test.go add test provider coverage around unknown vals 2019-03-29 13:56:42 -04:00
resource_map.go test for missing map entries 2019-01-23 17:04:17 -05:00
resource_map_test.go test for missing map entries 2019-01-23 17:04:17 -05:00
resource_nested.go add more tests for a computed nested list and set 2019-01-15 11:55:02 -05:00
resource_nested_id.go only force top-level id's back to unknown 2019-02-05 16:16:08 -05:00
resource_nested_id_test.go only force top-level id's back to unknown 2019-02-05 16:16:08 -05:00
resource_nested_set.go provider tests for empty values 2019-01-08 16:26:22 -05:00
resource_nested_set_test.go Additional tests with interpolated values 2019-02-07 20:23:39 -05:00
resource_nested_test.go add more tests for a computed nested list and set 2019-01-15 11:55:02 -05:00
resource_state_func.go add test fetching computed set value by address 2019-04-10 09:42:54 -04:00
resource_state_func_test.go add test fetching computed set value by address 2019-04-10 09:42:54 -04:00
resource_test.go create a downstream failure from a computed value 2019-04-03 17:36:08 -04:00
resource_timeout.go add timeout tests to the test provider 2018-10-30 13:14:08 -04:00
resource_timeout_test.go add timeout tests to the test provider 2018-10-30 13:14:08 -04:00
resource_undeletable.go core: Keep old value on error even for delete 2019-04-17 07:40:15 -07:00
resource_with_custom_diff.go provider/test: Added complex-ish list testing 2017-11-01 14:25:32 -07:00
resource_with_custom_diff_test.go provider/test: Added complex-ish list testing 2017-11-01 14:25:32 -07:00
splat_flatten_test.go udpate test configs to work with hcl2 2018-10-16 19:14:54 -07:00