terraform: graph root doesn't need to depend on providers

This commit is contained in:
Mitchell Hashimoto 2014-07-01 10:01:27 -07:00
parent 83795bc54d
commit 2ffbe56b1b
2 changed files with 5 additions and 2 deletions

View File

@ -400,6 +400,11 @@ func graphAddProviderConfigs(g *depgraph.Graph, c *config.Config) {
func graphAddRoot(g *depgraph.Graph) {
root := &depgraph.Noun{Name: GraphRootNode}
for _, n := range g.Nouns {
// The root only needs to depend on all the resources
if _, ok := n.Meta.(*GraphNodeResource); !ok {
continue
}
root.Deps = append(root.Deps, &depgraph.Dependency{
Name: n.Name,
Source: root,

View File

@ -224,7 +224,6 @@ root
root -> aws_load_balancer.weblb
root -> aws_security_group.firewall
root -> openstack_floating_ip.random
root -> provider.aws
`
const testTerraformGraphDiffStr = `
@ -269,5 +268,4 @@ root
root -> aws_load_balancer.weblb
root -> aws_security_group.firewall
root -> openstack_floating_ip.random
root -> provider.aws
`