terraform: orphan resources in old graph need unique ID

This commit is contained in:
Mitchell Hashimoto 2016-10-19 15:05:38 -07:00
parent d27c8fbbbc
commit fa25a3051b
No known key found for this signature in database
GPG Key ID: 744E147AA52F5B0A
3 changed files with 4 additions and 2 deletions

View File

@ -435,7 +435,7 @@ func (c *Context) Apply() (*State, error) {
}
// Walk the graph
walker, err := c.walk(real, shadow, operation)
walker, err := c.walk(real, real, operation)
if len(walker.ValidationErrors) > 0 {
err = multierror.Append(err, walker.ValidationErrors...)
}

View File

@ -510,7 +510,7 @@ func (p *shadowResourceProviderShadow) Apply(
p.ErrorLock.Lock()
defer p.ErrorLock.Unlock()
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
}

View File

@ -209,6 +209,8 @@ func (n *graphNodeOrphanResource) EvalTree() EvalNode {
// Build instance info
info := &InstanceInfo{Id: n.ResourceKey.String(), Type: n.ResourceKey.Type}
info.uniqueExtra = "destroy"
seq.Nodes = append(seq.Nodes, &EvalInstanceInfo{Info: info})
// Each resource mode has its own lifecycle