mirror of
https://github.com/opentofu/opentofu.git
synced 2024-12-30 10:47:14 -06:00
6c93fbb85d
Deposed instances need to be stored as a list for certain pathological cases where destroys fail for some reason (e.g. upstream API failure, Terraform interrupted mid-run). Terraform needs to be able to remember all Deposed nodes so that it can clean them up properly in subsequent runs. Deposed instances will now never touch the Tainted list - they're fully managed from within their own list. Added a "multiDepose" test case that walks through a scenario to exercise this.
21 lines
528 B
Go
21 lines
528 B
Go
package terraform
|
|
|
|
// EvalReturnError is an EvalNode implementation that returns an
|
|
// error if it is present.
|
|
//
|
|
// This is useful for scenarios where an error has been captured by
|
|
// another EvalNode (like EvalApply) for special EvalTree-based error
|
|
// handling, and that handling has completed, so the error should be
|
|
// returned normally.
|
|
type EvalReturnError struct {
|
|
Error *error
|
|
}
|
|
|
|
func (n *EvalReturnError) Eval(ctx EvalContext) (interface{}, error) {
|
|
if n.Error == nil {
|
|
return nil, nil
|
|
}
|
|
|
|
return nil, *n.Error
|
|
}
|