From c6fd938fb81d3732d16ebb77d21ffd8601998786 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Tue, 15 Nov 2016 09:02:10 -0800 Subject: [PATCH] terraform: EvalInstanceInfo on data sources in new graph This doesn't cause any practical issues as far as I'm aware (couldn't get any test to fail), but caused shadow errors since it wasn't matching the prior behavior. --- terraform/node_resource_apply.go | 5 +++++ terraform/shadow_resource_provider.go | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/terraform/node_resource_apply.go b/terraform/node_resource_apply.go index 0219e349b..f609b7dd5 100644 --- a/terraform/node_resource_apply.go +++ b/terraform/node_resource_apply.go @@ -75,6 +75,11 @@ func (n *NodeApplyableResource) evalTreeDataResource( return &EvalSequence{ Nodes: []EvalNode{ + // Build the instance info + &EvalInstanceInfo{ + Info: info, + }, + // Get the saved diff for apply &EvalReadDiff{ Name: stateId, diff --git a/terraform/shadow_resource_provider.go b/terraform/shadow_resource_provider.go index 4976fdc66..9741d7e79 100644 --- a/terraform/shadow_resource_provider.go +++ b/terraform/shadow_resource_provider.go @@ -682,7 +682,7 @@ func (p *shadowResourceProviderShadow) ReadDataDiff( p.ErrorLock.Lock() defer p.ErrorLock.Unlock() p.Error = multierror.Append(p.Error, fmt.Errorf( - "Unknown 'ReadDataDiff' shadow value: %#v", raw)) + "Unknown 'ReadDataDiff' shadow value for %q: %#v", key, raw)) return nil, nil } @@ -718,7 +718,7 @@ func (p *shadowResourceProviderShadow) ReadDataApply( p.ErrorLock.Lock() defer p.ErrorLock.Unlock() p.Error = multierror.Append(p.Error, fmt.Errorf( - "Unknown 'ReadDataApply' shadow value: %#v", raw)) + "Unknown 'ReadDataApply' shadow value for %q: %#v", key, raw)) return nil, nil }