mirror of https://github.com/helm/helm
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
531 B
27 lines
531 B
package action
|
|
|
|
import (
|
|
"io"
|
|
"text/template"
|
|
|
|
"github.com/Masterminds/sprig"
|
|
"github.com/kubernetes/deployment-manager/log"
|
|
)
|
|
|
|
// Render renders a template and values into an output stream.
|
|
//
|
|
// tpl should be a string template.
|
|
func Render(out io.Writer, tpl string, vals interface{}) error {
|
|
t, err := template.New("helmTpl").Funcs(sprig.TxtFuncMap()).Parse(tpl)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
log.Debug("Vals: %#v", vals)
|
|
|
|
if err := t.ExecuteTemplate(out, "helmTpl", vals); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}
|