Commit Graph

4 Commits

Author SHA1 Message Date
Paul Hinze 0036db8f82 provider/template: warn when template specified as path
Turns out the BC code allowed users to move from `filename` to
`template` to squash the warning without having to switch from template
paths to template contents.

Here we warn when `template` is specified as a path so we can remove the
functionality in the future and remove this source of confusion.

refs #3732
2016-03-10 12:34:56 -06:00
Mitchell Hashimoto aaf1302ce8 providers/template: don't use config/lang 2016-02-03 13:24:04 -05:00
Paul Hinze 0739cf2348 provider/template: fix race causing panic in template_file
The render code path in `template_file` was doing unsynchronized access
to a shared mapping of functions in `config.Func`.

This caused a race condition that was most often triggered when a
`template_file` had a `count` of more than one, and expressed itself as
a panic in the plugin followed by a cascade of "unexpected EOF" errors
through the plugin system.

Here, we simply turn the FuncMap from shared state into a generated
value, which avoids the race. We do more re-initialization of the data
structure, but the performance implications are minimal, and we can
always revisit with a perf pass later now that the race is fixed.
2016-01-15 16:34:46 -05:00
James Nugent abffa67a49 Rename resource.go -> resource_template_file.go
This is necessitated by new resources being added to the template
provider.
2015-12-21 13:32:26 -05:00