mirror of
https://github.com/opentofu/opentofu.git
synced 2025-02-25 18:45:20 -06:00
terraform: use the proper edge creation
This commit is contained in:
parent
5f791051a6
commit
30dcacf29f
@ -187,14 +187,7 @@ func graphDotAddResources(
|
|||||||
|
|
||||||
// Build up all the edges in a separate buffer so they're not in the
|
// Build up all the edges in a separate buffer so they're not in the
|
||||||
// subgraph.
|
// subgraph.
|
||||||
for _, e := range n.Edges() {
|
graphWriteEdges(&edgeBuf, n, opts)
|
||||||
target := e.Tail()
|
|
||||||
uniqueTarget := fmt.Sprintf("%d_%s", opts.depth, target)
|
|
||||||
edgeBuf.WriteString(fmt.Sprintf(
|
|
||||||
"\t\"%s\" -> \"%s\";\n",
|
|
||||||
uniqueName,
|
|
||||||
uniqueTarget))
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
buf.WriteString("\t}\n\n")
|
buf.WriteString("\t}\n\n")
|
||||||
if edgeBuf.Len() > 0 {
|
if edgeBuf.Len() > 0 {
|
||||||
@ -219,14 +212,7 @@ func graphDotAddResources(
|
|||||||
buf.WriteString(fmt.Sprintf(
|
buf.WriteString(fmt.Sprintf(
|
||||||
"\t\t\"%s\" [label=\"%s\",shape=box,style=filled,color=\"#FF0000\",fillcolor=\"#FF9494\"];\n", uniqueName, n))
|
"\t\t\"%s\" [label=\"%s\",shape=box,style=filled,color=\"#FF0000\",fillcolor=\"#FF9494\"];\n", uniqueName, n))
|
||||||
|
|
||||||
for _, e := range n.Edges() {
|
graphWriteEdges(&edgeBuf, n, opts)
|
||||||
target := e.Tail()
|
|
||||||
uniqueTarget := fmt.Sprintf("%d_%s", opts.depth, target)
|
|
||||||
edgeBuf.WriteString(fmt.Sprintf(
|
|
||||||
"\t\"%s\" -> \"%s\";\n",
|
|
||||||
uniqueName,
|
|
||||||
uniqueTarget))
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
buf.WriteString("\t}\n\n")
|
buf.WriteString("\t}\n\n")
|
||||||
if edgeBuf.Len() > 0 {
|
if edgeBuf.Len() > 0 {
|
||||||
@ -300,14 +286,7 @@ func graphDotAddResourceProviders(
|
|||||||
|
|
||||||
// Build up all the edges in a separate buffer so they're not in the
|
// Build up all the edges in a separate buffer so they're not in the
|
||||||
// subgraph.
|
// subgraph.
|
||||||
for _, e := range n.Edges() {
|
graphWriteEdges(&edgeBuf, n, opts)
|
||||||
target := e.Tail()
|
|
||||||
uniqueTarget := fmt.Sprintf("%d_%s", target)
|
|
||||||
edgeBuf.WriteString(fmt.Sprintf(
|
|
||||||
"\t\"%s\" -> \"%s\";\n",
|
|
||||||
uniqueName,
|
|
||||||
uniqueTarget))
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
buf.WriteString("\t}\n\n")
|
buf.WriteString("\t}\n\n")
|
||||||
if edgeBuf.Len() > 0 {
|
if edgeBuf.Len() > 0 {
|
||||||
|
Loading…
Reference in New Issue
Block a user