mirror of
https://github.com/opentofu/opentofu.git
synced 2025-02-25 18:45:20 -06:00
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
|
||||
}
|
||||
|
||||
// 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:"))
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user