From d87bdc2d2b3890471d69909f38663cd21028ff9d Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Wed, 19 Oct 2016 13:51:11 -0700 Subject: [PATCH] terraform: update destroy resource with proper unique-ifier for shadow This adds a proper unique extra field so that the shadow graph can properly compare values. --- terraform/node_resource_destroy.go | 5 +++-- terraform/shadow_resource_provider.go | 8 ++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/terraform/node_resource_destroy.go b/terraform/node_resource_destroy.go index a55a2c96f..52c34d1c7 100644 --- a/terraform/node_resource_destroy.go +++ b/terraform/node_resource_destroy.go @@ -81,8 +81,9 @@ func (n *NodeDestroyResource) EvalTree() EvalNode { // Build the instance info. More of this will be populated during eval info := &InstanceInfo{ - Id: stateId, - Type: n.Addr.Type, + Id: stateId, + Type: n.Addr.Type, + uniqueExtra: "destroy", } // Get our state diff --git a/terraform/shadow_resource_provider.go b/terraform/shadow_resource_provider.go index 4d7643438..bb80be31d 100644 --- a/terraform/shadow_resource_provider.go +++ b/terraform/shadow_resource_provider.go @@ -518,16 +518,16 @@ func (p *shadowResourceProviderShadow) Apply( if !state.Equal(result.State) { p.ErrorLock.Lock() p.Error = multierror.Append(p.Error, fmt.Errorf( - "Apply: state had unequal states (real, then shadow):\n\n%#v\n\n%#v", - result.State, state)) + "Apply %q: state had unequal states (real, then shadow):\n\n%#v\n\n%#v", + key, result.State, state)) p.ErrorLock.Unlock() } if !diff.Equal(result.Diff) { p.ErrorLock.Lock() p.Error = multierror.Append(p.Error, fmt.Errorf( - "Apply: unequal diffs (real, then shadow):\n\n%#v\n\n%#v", - result.Diff, diff)) + "Apply %q: unequal diffs (real, then shadow):\n\n%#v\n\n%#v", + key, result.Diff, diff)) p.ErrorLock.Unlock() }