terraform: validation eval nodes should filter on walkValidate

This commit is contained in:
Mitchell Hashimoto 2015-02-11 18:13:15 -08:00
parent 4089d33dea
commit baf26e9c92
1 changed files with 9 additions and 2 deletions

View File

@ -92,7 +92,8 @@ func (n *graphNodeExpandedResource) EvalTree() EvalNode {
seq := &EvalSequence{Nodes: make([]EvalNode, 0, 5)}
// 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]},
Config: &EvalInterpolate{Config: n.Resource.RawConfig},
ResourceName: n.Resource.Name,
@ -101,12 +102,18 @@ func (n *graphNodeExpandedResource) EvalTree() EvalNode {
// Validate all the provisioners
for _, p := range n.Resource.Provisioners {
seq.Nodes = append(seq.Nodes, &EvalValidateProvisioner{
vseq.Nodes = append(vseq.Nodes, &EvalValidateProvisioner{
Provisioner: &EvalGetProvisioner{Name: p.Type},
Config: &EvalInterpolate{Config: p.RawConfig},
})
}
// Add the validation operations
seq.Nodes = append(seq.Nodes, &EvalOpFilter{
Ops: []walkOperation{walkValidate},
Node: vseq,
})
// Build instance info
info := &InstanceInfo{Id: n.stateId(), Type: n.Resource.Type}
seq.Nodes = append(seq.Nodes, &EvalInstanceInfo{Info: info})