mirror of
https://github.com/opentofu/opentofu.git
synced 2025-01-03 20:57:09 -06:00
terraform: Validate expands properly
This commit is contained in:
parent
79520a19c4
commit
941e27b9f3
@ -956,7 +956,8 @@ func (c *walkContext) validateWalkFn() depgraph.WalkFunc {
|
||||
meta.Children = make(map[string]*walkValidateMeta)
|
||||
}
|
||||
|
||||
return func(n *depgraph.Noun) error {
|
||||
var walkFn depgraph.WalkFunc
|
||||
walkFn = func(n *depgraph.Noun) error {
|
||||
// If it is the root node, ignore
|
||||
if n.Name == GraphRootNode {
|
||||
return nil
|
||||
@ -988,6 +989,11 @@ func (c *walkContext) validateWalkFn() depgraph.WalkFunc {
|
||||
panic("resource should never be nil")
|
||||
}
|
||||
|
||||
// If we're expanding, then expand the nodes, and then rewalk the graph
|
||||
if rn.ExpandMode > ResourceExpandNone {
|
||||
return c.genericWalkResource(rn, walkFn)
|
||||
}
|
||||
|
||||
// If it doesn't have a provider, that is a different problem
|
||||
if rn.Resource.Provider == nil {
|
||||
return nil
|
||||
@ -1060,6 +1066,8 @@ func (c *walkContext) validateWalkFn() depgraph.WalkFunc {
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
return walkFn
|
||||
}
|
||||
|
||||
func (c *walkContext) genericWalkFn(cb genericWalkFunc) depgraph.WalkFunc {
|
||||
|
Loading…
Reference in New Issue
Block a user