From 87a375d49c3b0f98cb1fad150e53308a57b2da77 Mon Sep 17 00:00:00 2001 From: James Bardin Date: Tue, 18 Dec 2018 13:16:01 -0500 Subject: [PATCH] rename NodeDestroyableDataResourceInstance Make this node consistent with the naming if the other instances. --- terraform/node_data_destroy.go | 6 +++--- terraform/node_data_refresh.go | 2 +- terraform/node_data_refresh_test.go | 10 +++++----- terraform/node_resource_refresh.go | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/terraform/node_data_destroy.go b/terraform/node_data_destroy.go index fca54bcce..6ba39904d 100644 --- a/terraform/node_data_destroy.go +++ b/terraform/node_data_destroy.go @@ -5,14 +5,14 @@ import ( "github.com/hashicorp/terraform/states" ) -// NodeDestroyableDataResource represents a resource that is "destroyable": +// NodeDestroyableDataResourceInstance represents a resource that is "destroyable": // it is ready to be destroyed. -type NodeDestroyableDataResource struct { +type NodeDestroyableDataResourceInstance struct { *NodeAbstractResourceInstance } // GraphNodeEvalable -func (n *NodeDestroyableDataResource) EvalTree() EvalNode { +func (n *NodeDestroyableDataResourceInstance) EvalTree() EvalNode { addr := n.ResourceInstanceAddr() var providerSchema *ProviderSchema diff --git a/terraform/node_data_refresh.go b/terraform/node_data_refresh.go index 2b196ba3c..a086214d4 100644 --- a/terraform/node_data_refresh.go +++ b/terraform/node_data_refresh.go @@ -60,7 +60,7 @@ func (n *NodeRefreshableDataResource) DynamicExpand(ctx EvalContext) (*Graph, er a.Config = n.Config a.ResolvedProvider = n.ResolvedProvider - return &NodeDestroyableDataResource{ + return &NodeDestroyableDataResourceInstance{ NodeAbstractResourceInstance: a, } } diff --git a/terraform/node_data_refresh_test.go b/terraform/node_data_refresh_test.go index a6d5b9bb9..6b6059fa2 100644 --- a/terraform/node_data_refresh_test.go +++ b/terraform/node_data_refresh_test.go @@ -152,20 +152,20 @@ func TestNodeRefreshableDataResourceDynamicExpand_scaleIn(t *testing.T) { expected := `data.aws_instance.foo[0] - *terraform.NodeRefreshableDataResourceInstance data.aws_instance.foo[1] - *terraform.NodeRefreshableDataResourceInstance data.aws_instance.foo[2] - *terraform.NodeRefreshableDataResourceInstance -data.aws_instance.foo[3] - *terraform.NodeDestroyableDataResource +data.aws_instance.foo[3] - *terraform.NodeDestroyableDataResourceInstance root - terraform.graphNodeRoot data.aws_instance.foo[0] - *terraform.NodeRefreshableDataResourceInstance data.aws_instance.foo[1] - *terraform.NodeRefreshableDataResourceInstance data.aws_instance.foo[2] - *terraform.NodeRefreshableDataResourceInstance - data.aws_instance.foo[3] - *terraform.NodeDestroyableDataResource + data.aws_instance.foo[3] - *terraform.NodeDestroyableDataResourceInstance ` if expected != actual { t.Fatalf("Expected:\n%s\nGot:\n%s", expected, actual) } - var destroyableDataResource *NodeDestroyableDataResource + var destroyableDataResource *NodeDestroyableDataResourceInstance for _, v := range g.Vertices() { - if r, ok := v.(*NodeDestroyableDataResource); ok { + if r, ok := v.(*NodeDestroyableDataResourceInstance); ok { destroyableDataResource = r } } @@ -175,6 +175,6 @@ root - terraform.graphNodeRoot } if destroyableDataResource.ResolvedProvider.ProviderConfig.Type == "" { - t.Fatal("NodeDestroyableDataResource missing provider config") + t.Fatal("NodeDestroyableDataResourceInstance missing provider config") } } diff --git a/terraform/node_resource_refresh.go b/terraform/node_resource_refresh.go index 472eb853d..950602320 100644 --- a/terraform/node_resource_refresh.go +++ b/terraform/node_resource_refresh.go @@ -149,7 +149,7 @@ func (n *NodeRefreshableManagedResourceInstance) EvalTree() EvalNode { NodeAbstractResourceInstance: n.NodeAbstractResourceInstance, } } else { - dn = &NodeDestroyableDataResource{ + dn = &NodeDestroyableDataResourceInstance{ NodeAbstractResourceInstance: n.NodeAbstractResourceInstance, } }