Skip to content

Commit 154b9ce

Browse files
fix rebasing errors
1 parent 9e701f7 commit 154b9ce

File tree

2 files changed

+19
-20
lines changed

2 files changed

+19
-20
lines changed

internal/terraform/context_plan_actions_test.go

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2516,15 +2516,14 @@ resource "test_object" "a" {
25162516
expectPlanActionCalled: false,
25172517

25182518
expectPlanDiagnostics: func(m *configs.Config) tfdiags.Diagnostics {
2519-
// We only expect one diagnostic, as the other condition is valid
25202519
return tfdiags.Diagnostics{}.Append(&hcl.Diagnostic{
25212520
Severity: hcl.DiagError,
25222521
Summary: "Self reference not allowed",
25232522
Detail: `The condition expression cannot reference "self".`,
25242523
Subject: &hcl.Range{
25252524
Filename: filepath.Join(m.Module.SourceDir, "main.tf"),
2526-
Start: hcl.Pos{Line: 11, Column: 19, Byte: 199},
2527-
End: hcl.Pos{Line: 11, Column: 37, Byte: 217},
2525+
Start: hcl.Pos{Line: 9, Column: 19, Byte: 197},
2526+
End: hcl.Pos{Line: 9, Column: 37, Byte: 215},
25282527
},
25292528
})
25302529
},
@@ -2562,8 +2561,8 @@ resource "test_object" "a" {
25622561
Detail: `The condition expression cannot reference "self".`,
25632562
Subject: &hcl.Range{
25642563
Filename: filepath.Join(m.Module.SourceDir, "main.tf"),
2565-
Start: hcl.Pos{Line: 11, Column: 19, Byte: 198},
2566-
End: hcl.Pos{Line: 11, Column: 37, Byte: 216},
2564+
Start: hcl.Pos{Line: 9, Column: 19, Byte: 196},
2565+
End: hcl.Pos{Line: 9, Column: 37, Byte: 214},
25672566
},
25682567
})
25692568
},
@@ -2596,17 +2595,17 @@ resource "test_object" "a" {
25962595
Detail: `The condition expression cannot reference "each" if the action is run before the resource is applied.`,
25972596
Subject: &hcl.Range{
25982597
Filename: filepath.Join(m.Module.SourceDir, "main.tf"),
2599-
Start: hcl.Pos{Line: 12, Column: 19, Byte: 237},
2600-
End: hcl.Pos{Line: 12, Column: 36, Byte: 254},
2598+
Start: hcl.Pos{Line: 10, Column: 19, Byte: 235},
2599+
End: hcl.Pos{Line: 10, Column: 36, Byte: 252},
26012600
},
26022601
}).Append(&hcl.Diagnostic{
26032602
Severity: hcl.DiagError,
26042603
Summary: "Each reference not allowed",
26052604
Detail: `The condition expression cannot reference "each" if the action is run before the resource is applied.`,
26062605
Subject: &hcl.Range{
26072606
Filename: filepath.Join(m.Module.SourceDir, "main.tf"),
2608-
Start: hcl.Pos{Line: 12, Column: 19, Byte: 237},
2609-
End: hcl.Pos{Line: 12, Column: 36, Byte: 254},
2607+
Start: hcl.Pos{Line: 10, Column: 19, Byte: 235},
2608+
End: hcl.Pos{Line: 10, Column: 36, Byte: 252},
26102609
},
26112610
})
26122611
},
@@ -2679,26 +2678,26 @@ resource "test_object" "a" {
26792678
Detail: `The condition expression cannot reference "count" if the action is run before the resource is applied.`,
26802679
Subject: &hcl.Range{
26812680
Filename: filepath.Join(m.Module.SourceDir, "main.tf"),
2682-
Start: hcl.Pos{Line: 11, Column: 19, Byte: 226},
2683-
End: hcl.Pos{Line: 11, Column: 35, Byte: 242},
2681+
Start: hcl.Pos{Line: 10, Column: 21, Byte: 237},
2682+
End: hcl.Pos{Line: 10, Column: 37, Byte: 253},
26842683
},
26852684
}).Append(&hcl.Diagnostic{
26862685
Severity: hcl.DiagError,
26872686
Summary: "Count reference not allowed",
26882687
Detail: `The condition expression cannot reference "count" if the action is run before the resource is applied.`,
26892688
Subject: &hcl.Range{
26902689
Filename: filepath.Join(m.Module.SourceDir, "main.tf"),
2691-
Start: hcl.Pos{Line: 11, Column: 19, Byte: 226},
2692-
End: hcl.Pos{Line: 11, Column: 35, Byte: 242},
2690+
Start: hcl.Pos{Line: 10, Column: 21, Byte: 237},
2691+
End: hcl.Pos{Line: 10, Column: 37, Byte: 253},
26932692
},
26942693
}).Append(&hcl.Diagnostic{
26952694
Severity: hcl.DiagError,
26962695
Summary: "Count reference not allowed",
26972696
Detail: `The condition expression cannot reference "count" if the action is run before the resource is applied.`,
26982697
Subject: &hcl.Range{
26992698
Filename: filepath.Join(m.Module.SourceDir, "main.tf"),
2700-
Start: hcl.Pos{Line: 11, Column: 19, Byte: 226},
2701-
End: hcl.Pos{Line: 11, Column: 35, Byte: 242},
2699+
Start: hcl.Pos{Line: 10, Column: 21, Byte: 237},
2700+
End: hcl.Pos{Line: 10, Column: 37, Byte: 253},
27022701
},
27032702
})
27042703
},
@@ -2771,17 +2770,17 @@ resource "test_object" "a" {
27712770
Detail: `The condition expression cannot reference "each" if the action is run before the resource is applied.`,
27722771
Subject: &hcl.Range{
27732772
Filename: filepath.Join(m.Module.SourceDir, "main.tf"),
2774-
Start: hcl.Pos{Line: 11, Column: 19, Byte: 253},
2775-
End: hcl.Pos{Line: 11, Column: 41, Byte: 275},
2773+
Start: hcl.Pos{Line: 10, Column: 21, Byte: 264},
2774+
End: hcl.Pos{Line: 10, Column: 43, Byte: 286},
27762775
},
27772776
}).Append(&hcl.Diagnostic{
27782777
Severity: hcl.DiagError,
27792778
Summary: "Each reference not allowed",
27802779
Detail: `The condition expression cannot reference "each" if the action is run before the resource is applied.`,
27812780
Subject: &hcl.Range{
27822781
Filename: filepath.Join(m.Module.SourceDir, "main.tf"),
2783-
Start: hcl.Pos{Line: 11, Column: 19, Byte: 253},
2784-
End: hcl.Pos{Line: 11, Column: 41, Byte: 275},
2782+
Start: hcl.Pos{Line: 10, Column: 21, Byte: 264},
2783+
End: hcl.Pos{Line: 10, Column: 43, Byte: 286},
27852784
},
27862785
})
27872786
},

internal/terraform/node_action_trigger_apply.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ func (n *nodeActionTriggerApply) Execute(ctx EvalContext, wo walkOperation) tfdi
4040

4141
if n.ConditionExpr != nil {
4242
// We know this must be a lifecycle action, otherwise we would have no condition
43-
at := actionInvocation.ActionTrigger.(plans.LifecycleActionTrigger)
43+
at := actionInvocation.ActionTrigger.(*plans.LifecycleActionTrigger)
4444
condition, conditionDiags := evaluateActionCondition(ctx, actionConditionContext{
4545
// For applying the triggering event is sufficient, if the condition could not have
4646
// been evaluated due to in invalid mix of events we would have caught it durin planning.

0 commit comments

Comments
 (0)