mirror of
https://github.com/opentofu/opentofu.git
synced 2024-12-28 18:01:01 -06:00
terraform: Graph should overrride Remove to clear lookaside
This commit is contained in:
parent
dd14ce9a0b
commit
7e838dfae2
@ -54,6 +54,21 @@ func (g *Graph) Add(v dag.Vertex) dag.Vertex {
|
|||||||
return v
|
return v
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Remove is the same as dag.Graph.Remove
|
||||||
|
func (g *Graph) Remove(v dag.Vertex) dag.Vertex {
|
||||||
|
g.once.Do(g.init)
|
||||||
|
|
||||||
|
// If this is a depend-able node, then remove the lookaside info
|
||||||
|
if dv, ok := v.(GraphNodeDependable); ok {
|
||||||
|
for _, n := range dv.DependableName() {
|
||||||
|
delete(g.dependableMap, n)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Call upwards to remove it from the actual graph
|
||||||
|
return g.Graph.Remove(v)
|
||||||
|
}
|
||||||
|
|
||||||
// ConnectDependent connects a GraphNodeDependent to all of its
|
// ConnectDependent connects a GraphNodeDependent to all of its
|
||||||
// GraphNodeDependables. It returns the list of dependents it was
|
// GraphNodeDependables. It returns the list of dependents it was
|
||||||
// unable to connect to.
|
// unable to connect to.
|
||||||
|
Loading…
Reference in New Issue
Block a user