From 5fa24a0128ca91f1c54bfba9eebb56d434ac8559 Mon Sep 17 00:00:00 2001 From: James Bardin Date: Tue, 21 Nov 2017 17:24:26 -0500 Subject: [PATCH] output warning flag --- terraform/eval_output.go | 4 ++-- terraform/features.go | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/terraform/eval_output.go b/terraform/eval_output.go index cc83938eb..a8346276f 100644 --- a/terraform/eval_output.go +++ b/terraform/eval_output.go @@ -68,9 +68,9 @@ func (n *EvalWriteOutput) Eval(ctx EvalContext) (interface{}, error) { // handling the interpolation error if err != nil { - if n.ContinueOnErr { + if n.ContinueOnErr || flagWarnOutputErrors { log.Printf("[ERROR] Output interpolation %q failed: %s", n.Name, err) - // if we're continueing, make sure the output is included, and + // if we're continuing, make sure the output is included, and // marked as unknown mod.Outputs[n.Name] = &OutputState{ Type: "string", diff --git a/terraform/features.go b/terraform/features.go index 752076806..97c77bdbd 100644 --- a/terraform/features.go +++ b/terraform/features.go @@ -1,3 +1,7 @@ package terraform +import "os" + // This file holds feature flags for the next release + +var flagWarnOutputErrors = os.Getenv("TF_WARN_OUTPUT_ERRORS") != ""