mirror of
https://github.com/opentofu/opentofu.git
synced 2025-02-25 18:45:20 -06:00
Merge pull request #1833 from hashicorp/b-resource-test-warnings-are-ok
helper/resource: don't fail test on config warnings
This commit is contained in:
commit
fa04dfa731
@ -209,13 +209,16 @@ func testStep(
|
|||||||
opts.Destroy = step.Destroy
|
opts.Destroy = step.Destroy
|
||||||
ctx := terraform.NewContext(&opts)
|
ctx := terraform.NewContext(&opts)
|
||||||
if ws, es := ctx.Validate(); len(ws) > 0 || len(es) > 0 {
|
if ws, es := ctx.Validate(); len(ws) > 0 || len(es) > 0 {
|
||||||
estrs := make([]string, len(es))
|
if len(es) > 0 {
|
||||||
for i, e := range es {
|
estrs := make([]string, len(es))
|
||||||
estrs[i] = e.Error()
|
for i, e := range es {
|
||||||
|
estrs[i] = e.Error()
|
||||||
|
}
|
||||||
|
return state, fmt.Errorf(
|
||||||
|
"Configuration is invalid.\n\nWarnings: %#v\n\nErrors: %#v",
|
||||||
|
ws, estrs)
|
||||||
}
|
}
|
||||||
return state, fmt.Errorf(
|
log.Printf("[WARN] Config warnings: %#v", ws)
|
||||||
"Configuration is invalid.\n\nWarnings: %#v\n\nErrors: %#v",
|
|
||||||
ws, estrs)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Refresh!
|
// Refresh!
|
||||||
|
Loading…
Reference in New Issue
Block a user