rename NodeDestroyableDataResourceInstance
Make this node consistent with the naming if the other instances.
This commit is contained in:
parent
e73a8bb627
commit
87a375d49c
|
@ -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
|
||||
|
|
|
@ -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,
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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")
|
||||
}
|
||||
}
|
||||
|
|
|
@ -149,7 +149,7 @@ func (n *NodeRefreshableManagedResourceInstance) EvalTree() EvalNode {
|
|||
NodeAbstractResourceInstance: n.NodeAbstractResourceInstance,
|
||||
}
|
||||
} else {
|
||||
dn = &NodeDestroyableDataResource{
|
||||
dn = &NodeDestroyableDataResourceInstance{
|
||||
NodeAbstractResourceInstance: n.NodeAbstractResourceInstance,
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue