mirror of
https://github.com/opentofu/opentofu.git
synced 2024-12-28 01:41:48 -06:00
update prevent_destroy error message
per recommendations by @nathanielks closes #2473
This commit is contained in:
parent
2f2e594bd1
commit
22ea3d693f
@ -604,7 +604,7 @@ func TestContext2Plan_preventDestroy_bad(t *testing.T) {
|
||||
|
||||
plan, err := ctx.Plan()
|
||||
|
||||
expectedErr := "aws_instance.foo: plan would destroy"
|
||||
expectedErr := "aws_instance.foo: the plan would destroy"
|
||||
if !strings.Contains(fmt.Sprintf("%s", err), expectedErr) {
|
||||
t.Fatalf("expected err would contain %q\nerr: %s\nplan: %s",
|
||||
expectedErr, err, plan)
|
||||
|
@ -29,4 +29,4 @@ func (n *EvalCheckPreventDestroy) Eval(ctx EvalContext) (interface{}, error) {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
const preventDestroyErrStr = `%s: plan would destroy, but resource has prevent_destroy set. To avoid this error, either disable prevent_destroy, or change your config so the plan does not destroy this resource.`
|
||||
const preventDestroyErrStr = `%s: the plan would destroy this resource, but it currently has lifecycle.prevent_destroy set to true. To avoid this error and continue with the plan, either disable lifecycle.prevent_destroy or adjust the scope of the plan using the -target flag.`
|
||||
|
Loading…
Reference in New Issue
Block a user