destroy nodes can't be referenced directly

Destroy nodes were being referenced by their regular paths, which was
causing cycles in the graphs. Destroy nodes can't be referenced directly
in any way, so override the inherited method for a referenceable address.
This commit is contained in:
James Bardin 2018-05-21 19:17:24 -04:00 committed by Martin Atkins
parent 7137d85522
commit f8b77030db

View File

@ -71,6 +71,12 @@ func (n *NodeDestroyResourceInstance) ReferenceableName() []addrs.Referenceable
}
}
// Destroy nodes can't be directly referenced by anything, so we need to
// override the abstract method.
func (n *NodeDestroyResourceInstance) ReferenceableAddrs() []addrs.Referenceable {
return nil
}
// GraphNodeReferencer, overriding NodeAbstractResource
func (n *NodeDestroyResourceInstance) References() []*addrs.Reference {
// If we have a config, then we need to include destroy-time dependencies