mirror of
https://github.com/opentofu/opentofu.git
synced 2024-12-25 08:21:07 -06:00
Make sure each GraphBuilder has a Name
Ensure that each instance of BasucGraphBuilder gets a name corresponding to the Builder which created it. This allows us to differentiate the graphs in the logs.
This commit is contained in:
parent
bb137f4bfb
commit
3df3b99276
@ -30,7 +30,7 @@ type BasicGraphBuilder struct {
|
||||
func (b *BasicGraphBuilder) Build(path []string) (*Graph, error) {
|
||||
g := &Graph{Path: path}
|
||||
|
||||
debugName := "build-graph.json"
|
||||
debugName := "graph.json"
|
||||
if b.Name != "" {
|
||||
debugName = b.Name + "-" + debugName
|
||||
}
|
||||
@ -125,7 +125,7 @@ func (b *BuiltinGraphBuilder) Build(path []string) (*Graph, error) {
|
||||
basic := &BasicGraphBuilder{
|
||||
Steps: b.Steps(path),
|
||||
Validate: b.Validate,
|
||||
Name: "builtin",
|
||||
Name: "BuiltinGraphBuilder",
|
||||
}
|
||||
|
||||
return basic.Build(path)
|
||||
|
@ -40,7 +40,7 @@ func (b *ApplyGraphBuilder) Build(path []string) (*Graph, error) {
|
||||
return (&BasicGraphBuilder{
|
||||
Steps: b.Steps(),
|
||||
Validate: true,
|
||||
Name: "apply",
|
||||
Name: "ApplyGraphBuilder",
|
||||
}).Build(path)
|
||||
}
|
||||
|
||||
|
@ -26,7 +26,7 @@ func (b *DestroyPlanGraphBuilder) Build(path []string) (*Graph, error) {
|
||||
return (&BasicGraphBuilder{
|
||||
Steps: b.Steps(),
|
||||
Validate: true,
|
||||
Name: "destroy",
|
||||
Name: "DestroyPlanGraphBuilder",
|
||||
}).Build(path)
|
||||
}
|
||||
|
||||
|
@ -23,6 +23,7 @@ func (b *ImportGraphBuilder) Build(path []string) (*Graph, error) {
|
||||
return (&BasicGraphBuilder{
|
||||
Steps: b.Steps(),
|
||||
Validate: true,
|
||||
Name: "ImportGraphBuilder",
|
||||
}).Build(path)
|
||||
}
|
||||
|
||||
|
@ -38,7 +38,7 @@ func (b *PlanGraphBuilder) Build(path []string) (*Graph, error) {
|
||||
return (&BasicGraphBuilder{
|
||||
Steps: b.Steps(),
|
||||
Validate: true,
|
||||
Name: "plan",
|
||||
Name: "PlanGraphBuilder",
|
||||
}).Build(path)
|
||||
}
|
||||
|
||||
|
@ -191,7 +191,11 @@ func (n *GraphNodeConfigResource) DynamicExpand(ctx EvalContext) (*Graph, error)
|
||||
steps = append(steps, &RootTransformer{})
|
||||
|
||||
// Build the graph
|
||||
b := &BasicGraphBuilder{Steps: steps, Validate: true}
|
||||
b := &BasicGraphBuilder{
|
||||
Steps: steps,
|
||||
Validate: true,
|
||||
Name: "GraphNodeConfigResource",
|
||||
}
|
||||
return b.Build(ctx.Path())
|
||||
}
|
||||
|
||||
|
@ -74,7 +74,10 @@ func (n *NodeDestroyResource) DynamicExpand(ctx EvalContext) (*Graph, error) {
|
||||
steps = append(steps, &RootTransformer{})
|
||||
|
||||
// Build the graph
|
||||
b := &BasicGraphBuilder{Steps: steps}
|
||||
b := &BasicGraphBuilder{
|
||||
Steps: steps,
|
||||
Name: "NodeResourceDestroy",
|
||||
}
|
||||
return b.Build(ctx.Path())
|
||||
}
|
||||
|
||||
|
@ -101,6 +101,10 @@ func (n *NodePlannableResource) DynamicExpand(ctx EvalContext) (*Graph, error) {
|
||||
}
|
||||
|
||||
// Build the graph
|
||||
b := &BasicGraphBuilder{Steps: steps, Validate: true}
|
||||
b := &BasicGraphBuilder{
|
||||
Steps: steps,
|
||||
Validate: true,
|
||||
Name: "NodePlannableResource",
|
||||
}
|
||||
return b.Build(ctx.Path())
|
||||
}
|
||||
|
@ -142,6 +142,7 @@ func (t *CBDEdgeTransformer) depMap(
|
||||
&AttachStateTransformer{State: t.State},
|
||||
&ReferenceTransformer{},
|
||||
},
|
||||
Name: "CBDEdgeTransformer",
|
||||
}).Build(nil)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
Loading…
Reference in New Issue
Block a user