Skip to content

Commit c98606e

Browse files
we can't savely detect deprecations within provisioners during plan
1 parent 1d91e9c commit c98606e

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

internal/terraform/context_validate_test.go

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2836,6 +2836,30 @@ func TestContext2Validate_deprecatedAttr(t *testing.T) {
28362836
},
28372837
})
28382838
},
2839+
expectedPlanDiags: func(c *configs.Config) tfdiags.Diagnostics {
2840+
return tfdiags.Diagnostics{} // We can not connect this during planning
2841+
},
2842+
expectedApplyDiags: func(c *configs.Config) tfdiags.Diagnostics {
2843+
return tfdiags.Diagnostics{}.Append(&hcl.Diagnostic{
2844+
Severity: hcl.DiagWarning,
2845+
Summary: `Deprecated value used`,
2846+
Detail: `deprecated resource attribute used`,
2847+
Subject: &hcl.Range{
2848+
Filename: filepath.Join(c.Module.SourceDir, "main.tf"),
2849+
Start: hcl.Pos{Line: 6, Column: 36, Byte: 177},
2850+
End: hcl.Pos{Line: 6, Column: 57, Byte: 198},
2851+
},
2852+
}).Append(&hcl.Diagnostic{
2853+
Severity: hcl.DiagWarning,
2854+
Summary: `Deprecated value used`,
2855+
Detail: `deprecated resource attribute used`,
2856+
Subject: &hcl.Range{
2857+
Filename: filepath.Join(c.Module.SourceDir, "main.tf"),
2858+
Start: hcl.Pos{Line: 9, Column: 26, Byte: 284},
2859+
End: hcl.Pos{Line: 9, Column: 47, Byte: 305},
2860+
},
2861+
})
2862+
},
28392863
},
28402864

28412865
"in action config": {

0 commit comments

Comments
 (0)