helm/pkg/engine
Cory Snider 79df3926f6 fix(engine): parse fail messages with newlines
The templating engine handles errors originating from the `required` and
`fail` template functions specially, cleaning up the error messages to
be more presentable to users. Go's text/template package unfortunately
does not make this straightforward to implement. Despite
template.ExecError implementing Unwrap, the error value returned from
the template function cannot be retrieved using errors.As. The wrapped
error in ExecError is a pre-formatted error string with the template
function's error string interpolated in with the original error value
erased. Helm works around this limitation by delimiting the
template-supplied message and extracting the message out of the
ExecError string with a regex.

Fix the parsing of `required` and `fail` error messages containing
newlines by setting the regex flag to make `.` match newline characters.

Signed-off-by: Cory Snider <csnider@mirantis.com>
2021-08-10 12:38:43 -04:00
..
doc.go Removing tiller language 2020-05-21 15:26:16 -04:00
engine.go fix(engine): parse fail messages with newlines 2021-08-10 12:38:43 -04:00
engine_test.go fix(engine): parse fail messages with newlines 2021-08-10 12:38:43 -04:00
files.go Fix engine.newFiles doc comment 2020-02-06 11:13:20 -06:00
files_test.go ref(pkg/engine): make template specific functions private 2019-03-06 15:45:52 -08:00
funcs.go fix linting error with lookup function (#7969) 2020-04-22 10:09:34 -06:00
funcs_test.go fix linting error with lookup function (#7969) 2020-04-22 10:09:34 -06:00
lookup_func.go Merge pull request #9066 from scaat/fix-specification 2021-06-02 11:55:53 +01:00