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.
This commit is contained in:
Mitchell Hashimoto 2016-10-19 13:51:11 -07:00
parent c9c1912b34
commit d87bdc2d2b
No known key found for this signature in database
GPG Key ID: 744E147AA52F5B0A
2 changed files with 7 additions and 6 deletions

View File

@ -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

View File

@ -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()
}