terraform: validation eval nodes should filter on walkValidate
This commit is contained in:
parent
4089d33dea
commit
baf26e9c92
|
@ -92,7 +92,8 @@ func (n *graphNodeExpandedResource) EvalTree() EvalNode {
|
||||||
seq := &EvalSequence{Nodes: make([]EvalNode, 0, 5)}
|
seq := &EvalSequence{Nodes: make([]EvalNode, 0, 5)}
|
||||||
|
|
||||||
// Validate the resource
|
// Validate the resource
|
||||||
seq.Nodes = append(seq.Nodes, &EvalValidateResource{
|
vseq := &EvalSequence{Nodes: make([]EvalNode, 0, 5)}
|
||||||
|
vseq.Nodes = append(vseq.Nodes, &EvalValidateResource{
|
||||||
Provider: &EvalGetProvider{Name: n.ProvidedBy()[0]},
|
Provider: &EvalGetProvider{Name: n.ProvidedBy()[0]},
|
||||||
Config: &EvalInterpolate{Config: n.Resource.RawConfig},
|
Config: &EvalInterpolate{Config: n.Resource.RawConfig},
|
||||||
ResourceName: n.Resource.Name,
|
ResourceName: n.Resource.Name,
|
||||||
|
@ -101,12 +102,18 @@ func (n *graphNodeExpandedResource) EvalTree() EvalNode {
|
||||||
|
|
||||||
// Validate all the provisioners
|
// Validate all the provisioners
|
||||||
for _, p := range n.Resource.Provisioners {
|
for _, p := range n.Resource.Provisioners {
|
||||||
seq.Nodes = append(seq.Nodes, &EvalValidateProvisioner{
|
vseq.Nodes = append(vseq.Nodes, &EvalValidateProvisioner{
|
||||||
Provisioner: &EvalGetProvisioner{Name: p.Type},
|
Provisioner: &EvalGetProvisioner{Name: p.Type},
|
||||||
Config: &EvalInterpolate{Config: p.RawConfig},
|
Config: &EvalInterpolate{Config: p.RawConfig},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Add the validation operations
|
||||||
|
seq.Nodes = append(seq.Nodes, &EvalOpFilter{
|
||||||
|
Ops: []walkOperation{walkValidate},
|
||||||
|
Node: vseq,
|
||||||
|
})
|
||||||
|
|
||||||
// Build instance info
|
// Build instance info
|
||||||
info := &InstanceInfo{Id: n.stateId(), Type: n.Resource.Type}
|
info := &InstanceInfo{Id: n.stateId(), Type: n.Resource.Type}
|
||||||
seq.Nodes = append(seq.Nodes, &EvalInstanceInfo{Info: info})
|
seq.Nodes = append(seq.Nodes, &EvalInstanceInfo{Info: info})
|
||||||
|
|
Loading…
Reference in New Issue