terraform: enable plan shadow graph

This commit is contained in:
Mitchell Hashimoto 2016-11-08 08:32:36 -08:00
parent 1efdba9b30
commit 337abe3f62
No known key found for this signature in database
GPG Key ID: 744E147AA52F5B0A
4 changed files with 14 additions and 10 deletions

View File

@ -558,9 +558,6 @@ func (c *Context) Plan() (*Plan, error) {
shadow = nil
}
// TODO: remove when we're ready
shadow = nil
// Do the walk
walker, err := c.walk(real, shadow, operation)
if err != nil {
@ -853,7 +850,12 @@ func (c *Context) walk(
//
// This must be done BEFORE appending shadowWalkErr since the
// shadowWalkErr may include expected errors.
if c.shadowErr != nil && contextFailOnShadowError {
//
// We only do this if we don't have a real error. In the case of
// a real error, we can't guarantee what nodes were and weren't
// traversed in parallel scenarios so we can't guarantee no
// shadow errors.
if c.shadowErr != nil && contextFailOnShadowError && realErr == nil {
panic(multierror.Prefix(c.shadowErr, "shadow graph:"))
}

View File

@ -25,8 +25,9 @@ func (n *NodePlannableResourceInstance) EvalTree() EvalNode {
// Build the instance info. More of this will be populated during eval
info := &InstanceInfo{
Id: stateId,
Type: addr.Type,
Id: stateId,
Type: addr.Type,
ModulePath: normalizeModulePath(addr.Path),
}
// Build the resource for eval

View File

@ -26,8 +26,9 @@ func (n *NodePlannableResourceOrphan) EvalTree() EvalNode {
// Build the instance info. More of this will be populated during eval
info := &InstanceInfo{
Id: stateId,
Type: addr.Type,
Id: stateId,
Type: addr.Type,
ModulePath: normalizeModulePath(addr.Path),
}
// Declare a bunch of variables that are used for state during

View File

@ -466,7 +466,7 @@ func (p *shadowResourceProviderShadow) ValidateResource(t string, c *ResourceCon
p.ErrorLock.Lock()
defer p.ErrorLock.Unlock()
p.Error = multierror.Append(p.Error, fmt.Errorf(
"Unknown 'ValidateResource' shadow value: %#v", raw))
"Unknown 'ValidateResource' shadow value for %q: %#v", key, raw))
return nil, nil
}
@ -558,7 +558,7 @@ func (p *shadowResourceProviderShadow) Diff(
p.ErrorLock.Lock()
defer p.ErrorLock.Unlock()
p.Error = multierror.Append(p.Error, fmt.Errorf(
"Unknown 'diff' shadow value: %#v", raw))
"Unknown 'diff' shadow value for %q: %#v", key, raw))
return nil, nil
}