From 0474bcbcf1e11ca58c02b472a4facf1e5b1e745f Mon Sep 17 00:00:00 2001 From: Andrew Stuart Date: Fri, 9 Dec 2016 13:21:48 -0700 Subject: [PATCH] Document ToYaml function --- pkg/chartutil/files.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/chartutil/files.go b/pkg/chartutil/files.go index 5aa3ee302..8613044c5 100644 --- a/pkg/chartutil/files.go +++ b/pkg/chartutil/files.go @@ -146,6 +146,10 @@ func (f Files) AsSecrets() string { return ToYaml(m) } +// ToYaml takes an interface, marshals it to yaml, and returns a string. It will +// always return a string, even on marshal error (empty string). +// +// This is designed to be called from a template. func ToYaml(v interface{}) string { data, err := yaml.Marshal(v) if err != nil {