mirror of
https://github.com/helmfile/helmfile.git
synced 2026-10-18 19:01:50 +02:00
feat: Helmfile renders *.yaml.gotmpl in a K8s manifests/kustomization directory (#1745)
Related to #494 This feature is mostly a built-in alternative to the `incubator/raw` chart without external dependency and has access to helmfile's own template functions and template data. The expected use-case of this feature is to add arbitrary K8s resources to your deployment. Unlike the original issue raised in #494 this doesn't enable you to add arbitary resources to a release. That's another story. But this would be a good foundation for that, too.
This commit is contained in:
@@ -6,7 +6,7 @@ import (
|
||||
"text/template"
|
||||
)
|
||||
|
||||
func (c *Context) newTemplate() *template.Template {
|
||||
func (c *Context) CreateFuncMap() template.FuncMap {
|
||||
aliased := template.FuncMap{}
|
||||
|
||||
aliases := map[string]string{
|
||||
@@ -27,6 +27,12 @@ func (c *Context) newTemplate() *template.Template {
|
||||
funcMap[name] = f
|
||||
}
|
||||
|
||||
return funcMap
|
||||
}
|
||||
|
||||
func (c *Context) newTemplate() *template.Template {
|
||||
funcMap := c.CreateFuncMap()
|
||||
|
||||
tmpl := template.New("stringTemplate").Funcs(funcMap)
|
||||
if c.preRender {
|
||||
tmpl = tmpl.Option("missingkey=zero")
|
||||
|
||||
Reference in New Issue
Block a user