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:
parent
c9c1912b34
commit
d87bdc2d2b
|
@ -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
|
||||
|
|
|
@ -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()
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue