Merge pull request #2992 from hashicorp/d-prevent-destroy-errmsg-tweak
update prevent_destroy error message
This commit is contained in:
commit
109393d931
|
@ -604,7 +604,7 @@ func TestContext2Plan_preventDestroy_bad(t *testing.T) {
|
||||||
|
|
||||||
plan, err := ctx.Plan()
|
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) {
|
if !strings.Contains(fmt.Sprintf("%s", err), expectedErr) {
|
||||||
t.Fatalf("expected err would contain %q\nerr: %s\nplan: %s",
|
t.Fatalf("expected err would contain %q\nerr: %s\nplan: %s",
|
||||||
expectedErr, err, plan)
|
expectedErr, err, plan)
|
||||||
|
|
|
@ -29,4 +29,4 @@ func (n *EvalCheckPreventDestroy) Eval(ctx EvalContext) (interface{}, error) {
|
||||||
return nil, nil
|
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