terraform: clean up some functions
This commit is contained in:
parent
2d07f79c5a
commit
8420b58015
|
@ -117,7 +117,13 @@ func (c *Context) Apply() (*State, error) {
|
|||
|
||||
// Graph returns the graph for this context.
|
||||
func (c *Context) Graph() (*depgraph.Graph, error) {
|
||||
return c.graph()
|
||||
return Graph(&GraphOpts{
|
||||
Diff: c.diff,
|
||||
Module: c.module,
|
||||
Providers: c.providers,
|
||||
Provisioners: c.provisioners,
|
||||
State: c.state,
|
||||
})
|
||||
}
|
||||
|
||||
// Plan generates an execution plan for the given context.
|
||||
|
@ -248,16 +254,6 @@ func (c *Context) Validate() ([]string, []error) {
|
|||
return walkMeta.Warns, errs
|
||||
}
|
||||
|
||||
func (c *Context) graph() (*depgraph.Graph, error) {
|
||||
return Graph(&GraphOpts{
|
||||
Diff: c.diff,
|
||||
Module: c.module,
|
||||
Providers: c.providers,
|
||||
Provisioners: c.provisioners,
|
||||
State: c.state,
|
||||
})
|
||||
}
|
||||
|
||||
func (c *Context) acquireRun() chan<- struct{} {
|
||||
c.l.Lock()
|
||||
defer c.l.Unlock()
|
||||
|
@ -389,6 +385,11 @@ func (c *walkContext) Walk() error {
|
|||
return err
|
||||
}
|
||||
|
||||
if c.Operation == walkValidate {
|
||||
// Validation is the only one that doesn't calculate outputs
|
||||
return nil
|
||||
}
|
||||
|
||||
// We did an apply, so we need to calculate the outputs. If we have no
|
||||
// outputs, then we're done.
|
||||
m := c.Context.module
|
||||
|
|
Loading…
Reference in New Issue