mirror of
https://github.com/opentofu/opentofu.git
synced 2025-02-25 18:45:20 -06:00
enable output errors in dev branch
This commit is contained in:
parent
a7df650f01
commit
fef687c340
@ -3593,15 +3593,8 @@ output "out" {
|
||||
}
|
||||
|
||||
_, err = ctx.Plan()
|
||||
switch {
|
||||
case featureOutputErrors:
|
||||
if err == nil {
|
||||
t.Fatal("expected error")
|
||||
}
|
||||
default:
|
||||
if err != nil {
|
||||
t.Fatalf("plan err: %s", err)
|
||||
}
|
||||
if err == nil {
|
||||
t.Fatal("expected error")
|
||||
}
|
||||
}
|
||||
|
||||
@ -3648,15 +3641,7 @@ resource "aws_instance" "foo" {
|
||||
}
|
||||
|
||||
_, err = ctx.Plan()
|
||||
switch {
|
||||
case featureOutputErrors:
|
||||
if err == nil {
|
||||
t.Fatal("expected error")
|
||||
}
|
||||
default:
|
||||
if err != nil {
|
||||
t.Fatalf("plan err: %s", err)
|
||||
}
|
||||
if err == nil {
|
||||
t.Fatal("expected error")
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -68,22 +68,17 @@ func (n *EvalWriteOutput) Eval(ctx EvalContext) (interface{}, error) {
|
||||
|
||||
// handling the interpolation error
|
||||
if err != nil {
|
||||
switch {
|
||||
case featureOutputErrors:
|
||||
if n.ContinueOnErr {
|
||||
log.Printf("[ERROR] Output interpolation %q failed: %s", n.Name, err)
|
||||
// if we're continueing, make sure the output is included, and
|
||||
// marked as unknown
|
||||
mod.Outputs[n.Name] = &OutputState{
|
||||
Type: "string",
|
||||
Value: config.UnknownVariableValue,
|
||||
}
|
||||
return nil, EvalEarlyExitError{}
|
||||
if n.ContinueOnErr {
|
||||
log.Printf("[ERROR] Output interpolation %q failed: %s", n.Name, err)
|
||||
// if we're continueing, make sure the output is included, and
|
||||
// marked as unknown
|
||||
mod.Outputs[n.Name] = &OutputState{
|
||||
Type: "string",
|
||||
Value: config.UnknownVariableValue,
|
||||
}
|
||||
return nil, err
|
||||
default:
|
||||
log.Printf("[WARN] Output interpolation %q failed: %s", n.Name, err)
|
||||
return nil, EvalEarlyExitError{}
|
||||
}
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// Get the value from the config
|
||||
|
@ -1,9 +1,3 @@
|
||||
package terraform
|
||||
|
||||
import (
|
||||
"os"
|
||||
)
|
||||
|
||||
// This file holds feature flags for the next release
|
||||
|
||||
var featureOutputErrors = os.Getenv("TF_OUTPUT_ERRORS") != ""
|
||||
|
Loading…
Reference in New Issue
Block a user