enable output errors in dev branch

This commit is contained in:
James Bardin 2017-10-27 09:13:52 -04:00
parent a7df650f01
commit fef687c340
3 changed files with 13 additions and 39 deletions

View File

@ -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")
}
}

View File

@ -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

View File

@ -1,9 +1,3 @@
package terraform
import (
"os"
)
// This file holds feature flags for the next release
var featureOutputErrors = os.Getenv("TF_OUTPUT_ERRORS") != ""