terraform: orphan resources in old graph need unique ID
This commit is contained in:
parent
d27c8fbbbc
commit
fa25a3051b
|
@ -435,7 +435,7 @@ func (c *Context) Apply() (*State, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Walk the graph
|
// Walk the graph
|
||||||
walker, err := c.walk(real, shadow, operation)
|
walker, err := c.walk(real, real, operation)
|
||||||
if len(walker.ValidationErrors) > 0 {
|
if len(walker.ValidationErrors) > 0 {
|
||||||
err = multierror.Append(err, walker.ValidationErrors...)
|
err = multierror.Append(err, walker.ValidationErrors...)
|
||||||
}
|
}
|
||||||
|
|
|
@ -510,7 +510,7 @@ func (p *shadowResourceProviderShadow) Apply(
|
||||||
p.ErrorLock.Lock()
|
p.ErrorLock.Lock()
|
||||||
defer p.ErrorLock.Unlock()
|
defer p.ErrorLock.Unlock()
|
||||||
p.Error = multierror.Append(p.Error, fmt.Errorf(
|
p.Error = multierror.Append(p.Error, fmt.Errorf(
|
||||||
"Unknown 'apply' shadow value: %#v", raw))
|
"Unknown 'apply' shadow value for %q: %#v", key, raw))
|
||||||
return nil, nil
|
return nil, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -209,6 +209,8 @@ func (n *graphNodeOrphanResource) EvalTree() EvalNode {
|
||||||
|
|
||||||
// Build instance info
|
// Build instance info
|
||||||
info := &InstanceInfo{Id: n.ResourceKey.String(), Type: n.ResourceKey.Type}
|
info := &InstanceInfo{Id: n.ResourceKey.String(), Type: n.ResourceKey.Type}
|
||||||
|
info.uniqueExtra = "destroy"
|
||||||
|
|
||||||
seq.Nodes = append(seq.Nodes, &EvalInstanceInfo{Info: info})
|
seq.Nodes = append(seq.Nodes, &EvalInstanceInfo{Info: info})
|
||||||
|
|
||||||
// Each resource mode has its own lifecycle
|
// Each resource mode has its own lifecycle
|
||||||
|
|
Loading…
Reference in New Issue