terraform: delete destroy interfaces

This commit is contained in:
Mitchell Hashimoto 2017-01-26 19:39:24 -08:00
parent d820d186e1
commit 83e093a73e
No known key found for this signature in database
GPG Key ID: 744E147AA52F5B0A
2 changed files with 0 additions and 57 deletions

View File

@ -229,22 +229,6 @@ func (n *GraphNodeConfigResource) ProvisionedBy() []string {
return result
}
// GraphNodeDestroyable
func (n *GraphNodeConfigResource) DestroyNode() GraphNodeDestroy {
// If we're already a destroy node, then don't do anything
if n.Destroy {
return nil
}
result := &graphNodeResourceDestroy{
GraphNodeConfigResource: *n.Copy(),
Original: n,
}
result.Destroy = true
return result
}
// Same as GraphNodeConfigResource, but for flattening
type GraphNodeConfigResourceFlat struct {
*GraphNodeConfigResource
@ -288,27 +272,6 @@ func (n *GraphNodeConfigResourceFlat) ProvisionedBy() []string {
prefix)
}
// GraphNodeDestroyable impl.
func (n *GraphNodeConfigResourceFlat) DestroyNode() GraphNodeDestroy {
// Get our parent destroy node. If we don't have any, just return
raw := n.GraphNodeConfigResource.DestroyNode()
if raw == nil {
return nil
}
node, ok := raw.(*graphNodeResourceDestroy)
if !ok {
panic(fmt.Sprintf("unknown destroy node: %s %T", dag.VertexName(raw), raw))
}
// Otherwise, wrap it so that it gets the proper module treatment.
return &graphNodeResourceDestroyFlat{
graphNodeResourceDestroy: node,
PathValue: n.PathValue,
FlatCreateNode: n,
}
}
type graphNodeResourceDestroyFlat struct {
*graphNodeResourceDestroy

View File

@ -1,20 +0,0 @@
package terraform
import (
"github.com/hashicorp/terraform/dag"
)
// GraphNodeDestroy is the interface that must implemented by
// nodes that destroy.
type GraphNodeDestroy interface {
dag.Vertex
// CreateBeforeDestroy is called to check whether this node
// should be created before it is destroyed. The CreateBeforeDestroy
// transformer uses this information to setup the graph.
CreateBeforeDestroy() bool
// CreateNode returns the node used for the create side of this
// destroy. This must already exist within the graph.
CreateNode() dag.Vertex
}