From f68f2dff84d44d21f2fc851815456fd5c2d38f4e Mon Sep 17 00:00:00 2001 From: Michael McCord Date: Mon, 4 Feb 2019 16:10:11 -0500 Subject: [PATCH] Fail linting when `required` function fails. This is a revert of the original change that was made as a result of: https://github.com/helm/helm/issues/2347 And was made in: https://github.com/helm/helm/pull/4221 I believe this original change to be incorrect, hence the revert. Signed-off-by: Michael McCord --- pkg/engine/engine.go | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/pkg/engine/engine.go b/pkg/engine/engine.go index f3dd869c9..aa512a14e 100644 --- a/pkg/engine/engine.go +++ b/pkg/engine/engine.go @@ -19,7 +19,6 @@ package engine import ( "bytes" "fmt" - "log" "path" "sort" "strings" @@ -156,20 +155,10 @@ func (e *Engine) alterFuncMap(t *template.Template, referenceTpls map[string]ren // Add the 'required' function here funcMap["required"] = func(warn string, val interface{}) (interface{}, error) { if val == nil { - if e.LintMode { - // Don't fail on missing required values when linting - log.Printf("[INFO] Missing required value: %s", warn) - return "", nil - } // Convert nil to "" in case required is piped into other functions return "", fmt.Errorf(warn) } else if _, ok := val.(string); ok { if val == "" { - if e.LintMode { - // Don't fail on missing required values when linting - log.Printf("[INFO] Missing required value: %s", warn) - return val, nil - } return val, fmt.Errorf(warn) } }