we can't savely detect deprecations within provisioners during plan

This commit is contained in:
Daniel Schmidt 2026-01-21 15:58:55 +01:00
parent 7eaf6daf60
commit 3bafac0d56

View file

@ -2836,6 +2836,30 @@ func TestContext2Validate_deprecatedAttr(t *testing.T) {
},
})
},
expectedPlanDiags: func(c *configs.Config) tfdiags.Diagnostics {
return tfdiags.Diagnostics{} // We can not connect this during planning
},
expectedApplyDiags: func(c *configs.Config) tfdiags.Diagnostics {
return tfdiags.Diagnostics{}.Append(&hcl.Diagnostic{
Severity: hcl.DiagWarning,
Summary: `Deprecated value used`,
Detail: `deprecated resource attribute used`,
Subject: &hcl.Range{
Filename: filepath.Join(c.Module.SourceDir, "main.tf"),
Start: hcl.Pos{Line: 6, Column: 36, Byte: 177},
End: hcl.Pos{Line: 6, Column: 57, Byte: 198},
},
}).Append(&hcl.Diagnostic{
Severity: hcl.DiagWarning,
Summary: `Deprecated value used`,
Detail: `deprecated resource attribute used`,
Subject: &hcl.Range{
Filename: filepath.Join(c.Module.SourceDir, "main.tf"),
Start: hcl.Pos{Line: 9, Column: 26, Byte: 284},
End: hcl.Pos{Line: 9, Column: 47, Byte: 305},
},
})
},
},
"in action config": {