No need for a root name constant, just check for Meta == nil
This commit is contained in:
parent
9896d902ed
commit
23d96248aa
|
@ -9,10 +9,6 @@ import (
|
||||||
"github.com/hashicorp/terraform/depgraph"
|
"github.com/hashicorp/terraform/depgraph"
|
||||||
)
|
)
|
||||||
|
|
||||||
// GraphRoot is the name of the resource graph root that should be
|
|
||||||
// ignored since it doesn't map to an exact resource.
|
|
||||||
const GraphRoot = "root"
|
|
||||||
|
|
||||||
// Config is the configuration that comes from loading a collection
|
// Config is the configuration that comes from loading a collection
|
||||||
// of Terraform templates.
|
// of Terraform templates.
|
||||||
type Config struct {
|
type Config struct {
|
||||||
|
@ -207,7 +203,7 @@ func (c *Config) Graph() *depgraph.Graph {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create a root that just depends on everything else finishing.
|
// Create a root that just depends on everything else finishing.
|
||||||
root := &depgraph.Noun{Name: GraphRoot}
|
root := &depgraph.Noun{Name: "root"}
|
||||||
for _, n := range nounsList {
|
for _, n := range nounsList {
|
||||||
root.Deps = append(root.Deps, &depgraph.Dependency{
|
root.Deps = append(root.Deps, &depgraph.Dependency{
|
||||||
Name: n.Name,
|
Name: n.Name,
|
||||||
|
|
|
@ -107,7 +107,7 @@ func (t *Terraform) diffWalkFn(
|
||||||
|
|
||||||
return func(n *depgraph.Noun) error {
|
return func(n *depgraph.Noun) error {
|
||||||
// If it is the root node, ignore
|
// If it is the root node, ignore
|
||||||
if n.Name == config.GraphRoot {
|
if n.Meta == nil {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue