add actions prefix for clarity

pull/37545/head
Daniel Schmidt 6 months ago
parent 7150806334
commit 92cda9d8fe

@ -64,7 +64,7 @@ func (e *Evaluator) staticValidateReference(ref *addrs.Reference, modCfg *config
// this codepath doesn't really "know about". If the "self"
// object starts being supported in more contexts later then
// we'll need to adjust this message.
Detail: `The "self" object is not available in this context. This object can be used only in resource provisioner, connection, postcondition blocks, and in the action_trigger condition attributes of after_create & after_update actions.`,
Detail: `The "self" object is not available in this context. This object can be used only in resource provisioner, connection and postcondition blocks.`,
Subject: ref.SourceRange.ToHCL().Ptr(),
})
return diags

@ -41,7 +41,7 @@ func (n *nodeActionTriggerApply) Execute(ctx EvalContext, wo walkOperation) tfdi
if n.ConditionExpr != nil {
// We know this must be a lifecycle action, otherwise we would have no condition
at := actionInvocation.ActionTrigger.(plans.LifecycleActionTrigger)
condition, conditionDiags := evaluateCondition(ctx, conditionContext{
condition, conditionDiags := evaluateActionCondition(ctx, actionConditionContext{
// For applying the triggering event is sufficient, if the condition could not have
// been evaluated due to in invalid mix of events we would have caught it durin planning.
events: []configs.ActionTriggerEvent{at.ActionTriggerEvent},

@ -118,7 +118,7 @@ func (n *nodeActionTriggerPlanInstance) Execute(ctx EvalContext, operation walkO
// Evaluate the condition expression if it exists (otherwise it's true)
if n.lifecycleActionTrigger != nil && n.lifecycleActionTrigger.conditionExpr != nil {
condition, conditionDiags := evaluateCondition(ctx, conditionContext{
condition, conditionDiags := evaluateActionCondition(ctx, actionConditionContext{
events: n.lifecycleActionTrigger.events,
conditionExpr: n.lifecycleActionTrigger.conditionExpr,
resourceAddress: n.lifecycleActionTrigger.resourceAddress,
@ -207,13 +207,13 @@ func (n *nodeActionTriggerPlanInstance) Path() addrs.ModuleInstance {
return n.actionAddress.Module
}
type conditionContext struct {
type actionConditionContext struct {
events []configs.ActionTriggerEvent
conditionExpr hcl.Expression
resourceAddress addrs.AbsResourceInstance
}
func evaluateCondition(ctx EvalContext, at conditionContext) (bool, tfdiags.Diagnostics) {
func evaluateActionCondition(ctx EvalContext, at actionConditionContext) (bool, tfdiags.Diagnostics) {
var diags tfdiags.Diagnostics
rd := instances.RepetitionData{}

Loading…
Cancel
Save