feat: include func support (#1187)

* feat: include func support

Signed-off-by: yxxhero <aiopsclub@163.com>
This commit is contained in:
yxxhero
2023-12-04 21:51:01 +08:00
committed by GitHub
parent 06504477f6
commit 7d6ed97333
20 changed files with 380 additions and 53 deletions
+9 -1
View File
@@ -2,10 +2,18 @@ package tmpl
import (
"testing"
"github.com/helmfile/helmfile/pkg/filesystem"
)
func TestMergeOverwrite(t *testing.T) {
ctx := &Context{}
ctx := &Context{
fs: &filesystem.FileSystem{
Glob: func(pattern string) ([]string, error) {
return nil, nil
},
},
}
buf, err := ctx.RenderTemplateToBuffer(`
{{- $v1 := dict "bool" true "int" 2 "str" "v1" "str2" "v1" -}}
{{- $v2 := dict "bool" false "int" 0 "str" "v2" "str2" "" -}}