terraform: enable plan shadow graph
This commit is contained in:
parent
1efdba9b30
commit
337abe3f62
|
@ -558,9 +558,6 @@ func (c *Context) Plan() (*Plan, error) {
|
||||||
shadow = nil
|
shadow = nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: remove when we're ready
|
|
||||||
shadow = nil
|
|
||||||
|
|
||||||
// Do the walk
|
// Do the walk
|
||||||
walker, err := c.walk(real, shadow, operation)
|
walker, err := c.walk(real, shadow, operation)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -853,7 +850,12 @@ func (c *Context) walk(
|
||||||
//
|
//
|
||||||
// This must be done BEFORE appending shadowWalkErr since the
|
// This must be done BEFORE appending shadowWalkErr since the
|
||||||
// shadowWalkErr may include expected errors.
|
// 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:"))
|
panic(multierror.Prefix(c.shadowErr, "shadow graph:"))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -27,6 +27,7 @@ func (n *NodePlannableResourceInstance) EvalTree() EvalNode {
|
||||||
info := &InstanceInfo{
|
info := &InstanceInfo{
|
||||||
Id: stateId,
|
Id: stateId,
|
||||||
Type: addr.Type,
|
Type: addr.Type,
|
||||||
|
ModulePath: normalizeModulePath(addr.Path),
|
||||||
}
|
}
|
||||||
|
|
||||||
// Build the resource for eval
|
// Build the resource for eval
|
||||||
|
|
|
@ -28,6 +28,7 @@ func (n *NodePlannableResourceOrphan) EvalTree() EvalNode {
|
||||||
info := &InstanceInfo{
|
info := &InstanceInfo{
|
||||||
Id: stateId,
|
Id: stateId,
|
||||||
Type: addr.Type,
|
Type: addr.Type,
|
||||||
|
ModulePath: normalizeModulePath(addr.Path),
|
||||||
}
|
}
|
||||||
|
|
||||||
// Declare a bunch of variables that are used for state during
|
// Declare a bunch of variables that are used for state during
|
||||||
|
|
|
@ -466,7 +466,7 @@ func (p *shadowResourceProviderShadow) ValidateResource(t string, c *ResourceCon
|
||||||
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 'ValidateResource' shadow value: %#v", raw))
|
"Unknown 'ValidateResource' shadow value for %q: %#v", key, raw))
|
||||||
return nil, nil
|
return nil, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -558,7 +558,7 @@ func (p *shadowResourceProviderShadow) Diff(
|
||||||
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 'diff' shadow value: %#v", raw))
|
"Unknown 'diff' shadow value for %q: %#v", key, raw))
|
||||||
return nil, nil
|
return nil, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue