write provider to state for refresh nodes

and update the test state strings
This commit is contained in:
James Bardin 2017-11-07 20:53:18 -05:00
parent c2f3522f7d
commit 3977fe8b2d
4 changed files with 12 additions and 2 deletions

View File

@ -3527,28 +3527,34 @@ STATE:
aws_instance.bar.0:
ID = bar0
provider = provider.aws
Dependencies:
aws_instance.foo.*
aws_instance.bar.1:
ID = bar1
provider = provider.aws
Dependencies:
aws_instance.foo.*
aws_instance.baz.0:
ID = baz0
provider = provider.aws
Dependencies:
aws_instance.bar.*
aws_instance.baz.1:
ID = baz1
provider = provider.aws
Dependencies:
aws_instance.bar.*
aws_instance.foo.0:
ID = foo0
provider = provider.aws
aws_instance.foo.1:
ID = foo1
provider = provider.aws
`)
if actual != expected {
t.Fatalf("bad:\n%s\n\nexpected\n\n%s", actual, expected)

View File

@ -416,15 +416,18 @@ root
const testContextRefreshModuleStr = `
aws_instance.web: (tainted)
ID = bar
provider = provider.aws
module.child:
aws_instance.web:
ID = new
provider = provider.aws
`
const testContextRefreshOutputStr = `
aws_instance.web:
ID = foo
provider = provider.aws
foo = bar
Outputs:
@ -439,4 +442,5 @@ const testContextRefreshOutputPartialStr = `
const testContextRefreshTaintedStr = `
aws_instance.web: (tainted)
ID = foo
provider = provider.aws
`

View File

@ -275,7 +275,7 @@ func (n *NodeDestroyResource) EvalTree() EvalNode {
&EvalWriteState{
Name: stateId,
ResourceType: n.Addr.Type,
Provider: rs.Provider,
Provider: n.ResolvedProvider,
Dependencies: rs.Dependencies,
State: &state,
},

View File

@ -166,7 +166,7 @@ func (n *NodeRefreshableManagedResourceInstance) evalTreeManagedResource() EvalN
&EvalWriteState{
Name: stateId,
ResourceType: n.ResourceState.Type,
Provider: n.ResourceState.Provider,
Provider: n.ResolvedProvider,
Dependencies: n.ResourceState.Dependencies,
State: &state,
},