From 50bb60823f0d72376d805057eed1df6dd6bfca83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mika=C3=ABl=20Cluseau?= Date: Mon, 15 May 2023 15:54:23 +0200 Subject: [PATCH] yaml render func --- pkg/clustersconfig/clustersconfig.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkg/clustersconfig/clustersconfig.go b/pkg/clustersconfig/clustersconfig.go index 131b440..245e8aa 100644 --- a/pkg/clustersconfig/clustersconfig.go +++ b/pkg/clustersconfig/clustersconfig.go @@ -135,6 +135,11 @@ func (t *Template) Execute(contextName, elementName string, wr io.Writer, data i indented = indent + strings.Replace(s, "\n", "\n"+indent, -1) return }, + "yaml": func(v any) (s string, err error) { + ba, err := yaml.Marshal(v) + s = string(ba) + return + }, } for name, f := range extraFuncs {