From db6d87b16c1fd8ecc205d84af49e1769f1d128fe Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Thu, 20 Oct 2016 22:51:06 -0700 Subject: [PATCH] terraform: destroy node should understand data sources This makes the new destroy nodes undestand data sourcs and call the correct apply function. --- terraform/node_resource_destroy.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/terraform/node_resource_destroy.go b/terraform/node_resource_destroy.go index 8aed56381..4979f9726 100644 --- a/terraform/node_resource_destroy.go +++ b/terraform/node_resource_destroy.go @@ -2,6 +2,8 @@ package terraform import ( "fmt" + + "github.com/hashicorp/terraform/config" ) // NodeDestroyResource represents a resource that is to be destroyed. @@ -147,11 +149,9 @@ func (n *NodeDestroyResource) EvalTree() EvalNode { // Make sure we handle data sources properly. &EvalIf{ If: func(ctx EvalContext) (bool, error) { - /* TODO: data source - if n.Resource.Mode == config.DataResourceMode { + if n.Config.Mode == config.DataResourceMode { return true, nil } - */ return false, nil },