terraform: remove flatten, forever
This commit is contained in:
parent
6d731b3b46
commit
2beb62c92b
|
@ -1,21 +0,0 @@
|
||||||
package terraform
|
|
||||||
|
|
||||||
import (
|
|
||||||
"github.com/hashicorp/terraform/dag"
|
|
||||||
)
|
|
||||||
|
|
||||||
// GraphNodeFlatGraph must be implemented by nodes that have subgraphs
|
|
||||||
// that they want flattened into the graph.
|
|
||||||
type GraphNodeFlatGraph interface {
|
|
||||||
FlattenGraph() *Graph
|
|
||||||
}
|
|
||||||
|
|
||||||
// GraphNodeFlattenable must be implemented by all nodes that can be
|
|
||||||
// flattened. If a FlattenGraph returns any nodes that can't be flattened,
|
|
||||||
// it will be an error.
|
|
||||||
//
|
|
||||||
// If Flatten returns nil for the Vertex along with a nil error, it will
|
|
||||||
// removed from the graph.
|
|
||||||
type GraphNodeFlattenable interface {
|
|
||||||
Flatten(path []string) (dag.Vertex, error)
|
|
||||||
}
|
|
|
@ -111,18 +111,6 @@ func (t *MissingProvisionerTransformer) Transform(g *Graph) error {
|
||||||
NameValue: p,
|
NameValue: p,
|
||||||
PathValue: path,
|
PathValue: path,
|
||||||
}
|
}
|
||||||
if len(path) > 0 {
|
|
||||||
// If we have a path, we do the flattening immediately. This
|
|
||||||
// is to support new-style graph nodes that are already
|
|
||||||
// flattened.
|
|
||||||
if fn, ok := newV.(GraphNodeFlattenable); ok {
|
|
||||||
var err error
|
|
||||||
newV, err = fn.Flatten(path)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Add the missing provisioner node to the graph
|
// Add the missing provisioner node to the graph
|
||||||
m[key] = g.Add(newV)
|
m[key] = g.Add(newV)
|
||||||
|
|
Loading…
Reference in New Issue