mirror of
https://github.com/opentffoundation/opentf.git
synced 2026-04-30 16:03:37 -04:00
When validating self-references for resource and data source preconditions and postconditions, we previously did not nil-check the block's condition field, which caused a panic when the block had no condition. While fixing this I noticed that we were not validating that there are no self-references in the error message, so fixed that.
13 lines
342 B
HCL
13 lines
342 B
HCL
resource "example" "example" {
|
|
foo = 5
|
|
|
|
lifecycle {
|
|
precondition { # ERROR: Missing required argument
|
|
error_message = "Can a check block fail without a condition?"
|
|
}
|
|
postcondition { # ERROR: Missing required argument
|
|
error_message = "Do not try to pass the check; only realize that there is no check."
|
|
}
|
|
}
|
|
}
|