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)
|
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 it is the root node, ignore
|
||||||
if n.Name == GraphRootNode {
|
if n.Name == GraphRootNode {
|
||||||
return nil
|
return nil
|
||||||
|
@ -988,6 +989,11 @@ func (c *walkContext) validateWalkFn() depgraph.WalkFunc {
|
||||||
panic("resource should never be nil")
|
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 it doesn't have a provider, that is a different problem
|
||||||
if rn.Resource.Provider == nil {
|
if rn.Resource.Provider == nil {
|
||||||
return nil
|
return nil
|
||||||
|
@ -1060,6 +1066,8 @@ func (c *walkContext) validateWalkFn() depgraph.WalkFunc {
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return walkFn
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *walkContext) genericWalkFn(cb genericWalkFunc) depgraph.WalkFunc {
|
func (c *walkContext) genericWalkFn(cb genericWalkFunc) depgraph.WalkFunc {
|
||||||
|
|
Loading…
Reference in New Issue