Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions internal/terraform/node_action_trigger_instance_plan.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"fmt"

"github.com/hashicorp/hcl/v2"
"github.com/zclconf/go-cty/cty"

"github.com/hashicorp/terraform/internal/addrs"
"github.com/hashicorp/terraform/internal/configs"
Expand All @@ -17,7 +18,6 @@ import (
"github.com/hashicorp/terraform/internal/plans/deferring"
"github.com/hashicorp/terraform/internal/providers"
"github.com/hashicorp/terraform/internal/tfdiags"
"github.com/zclconf/go-cty/cty"
)

type nodeActionTriggerPlanInstance struct {
Expand Down Expand Up @@ -89,7 +89,8 @@ func (n *nodeActionTriggerPlanInstance) Execute(ctx EvalContext, operation walkO
}

if change == nil {
panic("change cannot be nil")
// nothing to do (this may be a refresh )
return nil
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We might want something more robust here eventually, having a nil change under any other circumstance is worthy of a panic (and with the refactoring that will probably continue around actions, mistakes like a missing change are even more likely)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps we shouldn't have even gotten to this point during a refresh only plan, since actions are in effect changes, and we're promising that there can be no changes with -refresh-only.

}

if n.lifecycleActionTrigger == nil {
Expand Down
Loading