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
|
// Build the instance info. More of this will be populated during eval
|
||||||
info := &InstanceInfo{
|
info := &InstanceInfo{
|
||||||
Id: stateId,
|
Id: stateId,
|
||||||
Type: n.Addr.Type,
|
Type: n.Addr.Type,
|
||||||
|
uniqueExtra: "destroy",
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get our state
|
// Get our state
|
||||||
|
|
|
@ -518,16 +518,16 @@ func (p *shadowResourceProviderShadow) Apply(
|
||||||
if !state.Equal(result.State) {
|
if !state.Equal(result.State) {
|
||||||
p.ErrorLock.Lock()
|
p.ErrorLock.Lock()
|
||||||
p.Error = multierror.Append(p.Error, fmt.Errorf(
|
p.Error = multierror.Append(p.Error, fmt.Errorf(
|
||||||
"Apply: state had unequal states (real, then shadow):\n\n%#v\n\n%#v",
|
"Apply %q: state had unequal states (real, then shadow):\n\n%#v\n\n%#v",
|
||||||
result.State, state))
|
key, result.State, state))
|
||||||
p.ErrorLock.Unlock()
|
p.ErrorLock.Unlock()
|
||||||
}
|
}
|
||||||
|
|
||||||
if !diff.Equal(result.Diff) {
|
if !diff.Equal(result.Diff) {
|
||||||
p.ErrorLock.Lock()
|
p.ErrorLock.Lock()
|
||||||
p.Error = multierror.Append(p.Error, fmt.Errorf(
|
p.Error = multierror.Append(p.Error, fmt.Errorf(
|
||||||
"Apply: unequal diffs (real, then shadow):\n\n%#v\n\n%#v",
|
"Apply %q: unequal diffs (real, then shadow):\n\n%#v\n\n%#v",
|
||||||
result.Diff, diff))
|
key, result.Diff, diff))
|
||||||
p.ErrorLock.Unlock()
|
p.ErrorLock.Unlock()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue