diff --git a/docs/templates.md b/docs/templates.md index e59e0c7e9..ea0a2d578 100644 --- a/docs/templates.md +++ b/docs/templates.md @@ -161,6 +161,15 @@ dir: {{.}} {{end}} ``` +### join + +Alias for the strings.Join function. + +``` +{{$services := getvs "/services/elasticsearch/*"}} +services: {{join $services ","}} +``` + ## Example Usage ```Bash diff --git a/resource/template/template_funcs.go b/resource/template/template_funcs.go index 89853fcdd..8e55d912c 100644 --- a/resource/template/template_funcs.go +++ b/resource/template/template_funcs.go @@ -15,6 +15,7 @@ func newFuncMap() map[string]interface{} { m["jsonArray"] = UnmarshalJsonArray m["dir"] = path.Dir m["getenv"] = os.Getenv + m["join"] = strings.Join return m }