mirror of
https://github.com/opentofu/opentofu.git
synced 2025-02-25 18:45:20 -06:00
core: flatten orphan modules
This commit is contained in:
parent
75f000e0cc
commit
a5e4e3de59
@ -1,6 +1,7 @@
|
|||||||
package terraform
|
package terraform
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
"log"
|
"log"
|
||||||
|
|
||||||
"github.com/hashicorp/terraform/dag"
|
"github.com/hashicorp/terraform/dag"
|
||||||
@ -59,3 +60,26 @@ func (n *GraphNodeBasicSubgraph) Name() string {
|
|||||||
func (n *GraphNodeBasicSubgraph) Subgraph() *Graph {
|
func (n *GraphNodeBasicSubgraph) Subgraph() *Graph {
|
||||||
return n.Graph
|
return n.Graph
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (n *GraphNodeBasicSubgraph) Flatten(p []string) (dag.Vertex, error) {
|
||||||
|
return &graphNodeBasicSubgraphFlat{
|
||||||
|
GraphNodeBasicSubgraph: n,
|
||||||
|
PathValue: p,
|
||||||
|
}, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// Same as GraphNodeBasicSubgraph, but for flattening
|
||||||
|
type graphNodeBasicSubgraphFlat struct {
|
||||||
|
*GraphNodeBasicSubgraph
|
||||||
|
|
||||||
|
PathValue []string
|
||||||
|
}
|
||||||
|
|
||||||
|
func (n *graphNodeBasicSubgraphFlat) Name() string {
|
||||||
|
return fmt.Sprintf(
|
||||||
|
"%s.%s", modulePrefixStr(n.PathValue), n.GraphNodeBasicSubgraph.Name())
|
||||||
|
}
|
||||||
|
|
||||||
|
func (n *graphNodeBasicSubgraphFlat) Path() []string {
|
||||||
|
return n.PathValue
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user