|
|
|
|
@ -255,6 +255,10 @@ func (n *NodePlannableResourceInstance) managedResourceExecute(ctx EvalContext)
|
|
|
|
|
instanceRefreshState, readDiags = n.readResourceInstanceState(ctx, addr)
|
|
|
|
|
diags = diags.Append(readDiags)
|
|
|
|
|
if diags.HasErrors() {
|
|
|
|
|
// Pre-Diff error hook
|
|
|
|
|
diags = diags.Append(ctx.Hook(func(h Hook) (HookAction, error) {
|
|
|
|
|
return h.PreDiff(n.HookResourceIdentity(), addrs.NotDeposed, cty.DynamicVal, cty.DynamicVal, diags.Err())
|
|
|
|
|
}))
|
|
|
|
|
return diags
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@ -267,12 +271,20 @@ func (n *NodePlannableResourceInstance) managedResourceExecute(ctx EvalContext)
|
|
|
|
|
// refresh step below.
|
|
|
|
|
diags = diags.Append(n.writeResourceInstanceState(ctx, instanceRefreshState, prevRunState))
|
|
|
|
|
if diags.HasErrors() {
|
|
|
|
|
// Pre-Diff error hook
|
|
|
|
|
diags = diags.Append(ctx.Hook(func(h Hook) (HookAction, error) {
|
|
|
|
|
return h.PreDiff(n.HookResourceIdentity(), addrs.NotDeposed, cty.DynamicVal, cty.DynamicVal, diags.Err())
|
|
|
|
|
}))
|
|
|
|
|
return diags
|
|
|
|
|
}
|
|
|
|
|
// Also the refreshState, because that should still reflect schema upgrades
|
|
|
|
|
// even if it doesn't reflect upstream changes.
|
|
|
|
|
diags = diags.Append(n.writeResourceInstanceState(ctx, instanceRefreshState, refreshState))
|
|
|
|
|
if diags.HasErrors() {
|
|
|
|
|
// Pre-Diff error hook
|
|
|
|
|
diags = diags.Append(ctx.Hook(func(h Hook) (HookAction, error) {
|
|
|
|
|
return h.PreDiff(n.HookResourceIdentity(), addrs.NotDeposed, cty.DynamicVal, cty.DynamicVal, diags.Err())
|
|
|
|
|
}))
|
|
|
|
|
return diags
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@ -319,6 +331,10 @@ func (n *NodePlannableResourceInstance) managedResourceExecute(ctx EvalContext)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if diags.HasErrors() {
|
|
|
|
|
// Pre-Diff error hook
|
|
|
|
|
diags = diags.Append(ctx.Hook(func(h Hook) (HookAction, error) {
|
|
|
|
|
return h.PreDiff(n.HookResourceIdentity(), addrs.NotDeposed, cty.DynamicVal, cty.DynamicVal, diags.Err())
|
|
|
|
|
}))
|
|
|
|
|
return diags
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@ -329,6 +345,10 @@ func (n *NodePlannableResourceInstance) managedResourceExecute(ctx EvalContext)
|
|
|
|
|
// sure we still update any changes to CreateBeforeDestroy.
|
|
|
|
|
diags = diags.Append(n.writeResourceInstanceState(ctx, instanceRefreshState, refreshState))
|
|
|
|
|
if diags.HasErrors() {
|
|
|
|
|
// Pre-Diff error hook
|
|
|
|
|
diags = diags.Append(ctx.Hook(func(h Hook) (HookAction, error) {
|
|
|
|
|
return h.PreDiff(n.HookResourceIdentity(), addrs.NotDeposed, cty.DynamicVal, cty.DynamicVal, diags.Err())
|
|
|
|
|
}))
|
|
|
|
|
return diags
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@ -349,6 +369,10 @@ func (n *NodePlannableResourceInstance) managedResourceExecute(ctx EvalContext)
|
|
|
|
|
|
|
|
|
|
diags = diags.Append(n.replaceTriggered(ctx, repData))
|
|
|
|
|
if diags.HasErrors() {
|
|
|
|
|
// Pre-Diff error hook
|
|
|
|
|
diags = diags.Append(ctx.Hook(func(h Hook) (HookAction, error) {
|
|
|
|
|
return h.PreDiff(n.HookResourceIdentity(), addrs.NotDeposed, cty.DynamicVal, cty.DynamicVal, diags.Err())
|
|
|
|
|
}))
|
|
|
|
|
return diags
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|