]> git.immae.eu Git - github/fretlink/terraform-provider-statuscake.git/blob - vendor/github.com/hashicorp/terraform/terraform/graph_builder_validate.go
Upgrade to 0.12
[github/fretlink/terraform-provider-statuscake.git] / vendor / github.com / hashicorp / terraform / terraform / graph_builder_validate.go
1 package terraform
2
3 import (
4 "github.com/hashicorp/terraform/dag"
5 )
6
7 // ValidateGraphBuilder creates the graph for the validate operation.
8 //
9 // ValidateGraphBuilder is based on the PlanGraphBuilder. We do this so that
10 // we only have to validate what we'd normally plan anyways. The
11 // PlanGraphBuilder given will be modified so it shouldn't be used for anything
12 // else after calling this function.
13 func ValidateGraphBuilder(p *PlanGraphBuilder) GraphBuilder {
14 // We're going to customize the concrete functions
15 p.CustomConcrete = true
16
17 // Set the provider to the normal provider. This will ask for input.
18 p.ConcreteProvider = func(a *NodeAbstractProvider) dag.Vertex {
19 return &NodeApplyableProvider{
20 NodeAbstractProvider: a,
21 }
22 }
23
24 p.ConcreteResource = func(a *NodeAbstractResource) dag.Vertex {
25 return &NodeValidatableResource{
26 NodeAbstractResource: a,
27 }
28 }
29
30 // We purposely don't set any other concrete types since they don't
31 // require validation.
32
33 return p
34 }