terraform/states
Martin Atkins faddb83a92 core: If create leg of create_before_destroy fails, restore deposed
I misunderstood the logic here on the first pass of porting to the new
provider and state types: EvalUndeposeState is supposed to return the
deposed object back to being current again, so we can undo the deposing
in the case where the create leg fails.

If we don't do this, we end up leaving the instance with no current object
at all and with its prior object deposed, and then the later destroy
node deletes that deposed object, leaving the user with no object at all.

For safety we skip this restoration if there _is_ a new current object,
since a failed create can still produce a partial result which we need
to keep to avoid losing track of any remote objects that were successfully
created.
2018-10-16 19:14:11 -07:00
..
statefile states: object Private data is []byte, not cty.Value 2018-10-16 19:11:09 -07:00
statemgr states/statemgr: don't panic if no state file is present on first write 2018-10-16 19:14:11 -07:00
doc.go states: New package with modern models for Terraform state 2018-10-16 18:49:20 -07:00
eachmode_string.go states: New package with modern models for Terraform state 2018-10-16 18:49:20 -07:00
instance_generation.go states: New package with modern models for Terraform state 2018-10-16 18:49:20 -07:00
instance_object.go core: Reinstaint instance tainting, but without mutating objects 2018-10-16 19:14:11 -07:00
instance_object_src.go states: object Private data is []byte, not cty.Value 2018-10-16 19:11:09 -07:00
module.go core: If create leg of create_before_destroy fails, restore deposed 2018-10-16 19:14:11 -07:00
objectstatus_string.go states: New package with modern models for Terraform state 2018-10-16 18:49:20 -07:00
output_value.go states: New package with modern models for Terraform state 2018-10-16 18:49:20 -07:00
resource.go core: Be more explicit in how we handle create_before_destroy 2018-10-16 19:14:11 -07:00
resource_test.go terraform: Ugly huge change to weave in new State and Plan types 2018-10-16 19:11:09 -07:00
state.go core: Be more explicit in how we handle create_before_destroy 2018-10-16 19:14:11 -07:00
state_deepcopy.go states: DeepCopy for ResourceInstanceObject 2018-10-16 19:14:11 -07:00
state_equal.go states: New package with modern models for Terraform state 2018-10-16 18:49:20 -07:00
state_string.go states: In Module.testString, use incrementing ids for deposed 2018-10-16 19:14:11 -07:00
state_test.go terraform: Ugly huge change to weave in new State and Plan types 2018-10-16 19:11:09 -07:00
sync.go core: If create leg of create_before_destroy fails, restore deposed 2018-10-16 19:14:11 -07:00