terraform: new graph nodes implement Dotter
This commit is contained in:
parent
4c9d9ffae8
commit
9197422881
|
@ -4,6 +4,7 @@ import (
|
|||
"fmt"
|
||||
|
||||
"github.com/hashicorp/terraform/config"
|
||||
"github.com/hashicorp/terraform/dag"
|
||||
)
|
||||
|
||||
// NodeAbstractProvider represents a provider that has no associated operations.
|
||||
|
@ -60,3 +61,14 @@ func (n *NodeAbstractProvider) ProviderConfig() *config.RawConfig {
|
|||
func (n *NodeAbstractProvider) AttachProvider(c *config.ProviderConfig) {
|
||||
n.Config = c
|
||||
}
|
||||
|
||||
// GraphNodeDotter impl.
|
||||
func (n *NodeAbstractProvider) DotNode(name string, opts *dag.DotOpts) *dag.DotNode {
|
||||
return &dag.DotNode{
|
||||
Name: name,
|
||||
Attrs: map[string]string{
|
||||
"label": n.Name(),
|
||||
"shape": "diamond",
|
||||
},
|
||||
}
|
||||
}
|
||||
|
|
|
@ -166,3 +166,14 @@ func (n *NodeAbstractResource) AttachResourceState(s *ResourceState) {
|
|||
func (n *NodeAbstractResource) AttachResourceConfig(c *config.Resource) {
|
||||
n.Config = c
|
||||
}
|
||||
|
||||
// GraphNodeDotter impl.
|
||||
func (n *NodeAbstractResource) DotNode(name string, opts *dag.DotOpts) *dag.DotNode {
|
||||
return &dag.DotNode{
|
||||
Name: name,
|
||||
Attrs: map[string]string{
|
||||
"label": n.Name(),
|
||||
"shape": "box",
|
||||
},
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue