Skip to content

Commit 83a79b7

Browse files
committed
add Addr field for logging
1 parent 199ae20 commit 83a79b7

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

terraform/eval_state.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -581,6 +581,8 @@ func (n *EvalRefreshDependencies) Eval(ctx EvalContext) (interface{}, error) {
581581
// the status of the lifecycle options stored in the state.
582582
// This currently only applies to create_before_destroy.
583583
type EvalRefreshLifecycle struct {
584+
Addr addrs.AbsResourceInstance
585+
584586
Config *configs.Resource
585587
// Prior State
586588
State **states.ResourceInstanceObject
@@ -599,7 +601,8 @@ func (n *EvalRefreshLifecycle) Eval(ctx EvalContext) (interface{}, error) {
599601
// In 0.13 we could be refreshing a resource with no config.
600602
// We should be operating on managed resource, but check here to be certain
601603
if n.Config == nil || n.Config.Managed == nil {
602-
log.Print("[WARN] no Managed config value found in instance state")
604+
log.Printf("[WARN] EvalRefreshLifecycle: no Managed config value found in instance state for %q", n.Addr)
605+
return nil, nil
603606
}
604607

605608
state.CreateBeforeDestroy = n.Config.Managed.CreateBeforeDestroy || n.ForceCreateBeforeDestroy

terraform/node_resource_plan_instance.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ func (n *NodePlannableResourceInstance) evalTreeManagedResource(addr addrs.AbsRe
146146
Dependencies: &n.Dependencies,
147147
},
148148
&EvalRefreshLifecycle{
149+
Addr: addr,
149150
Config: n.Config,
150151
State: &instanceRefreshState,
151152
ForceCreateBeforeDestroy: n.ForceCreateBeforeDestroy,

0 commit comments

Comments
 (0)