terraform: initialize and attach module state
This commit is contained in:
parent
6e1ef1c634
commit
ec1c026b80
|
@ -362,6 +362,14 @@ func graphAddConfigModules(
|
|||
if n, err := graphModuleNoun(m.Name, m, g, opts); err != nil {
|
||||
return err
|
||||
} else {
|
||||
// Attach the module state if any
|
||||
if opts.State != nil {
|
||||
module := n.Meta.(*GraphNodeModule)
|
||||
module.State = opts.State.ModuleByPath(module.Path)
|
||||
if module.State == nil {
|
||||
module.State = opts.State.AddModule(module.Path)
|
||||
}
|
||||
}
|
||||
nounsList = append(nounsList, n)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue