func ToYaml(v interface{}) string {
	data, err := yaml.Marshal(v)
	if err != nil {
		return ""
	}
	return string(data)
}
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.
package chartutil
import (
	"bytes"
	"encoding/base64"
	"encoding/json"
	"path"
	"strings"
	"github.com/ghodss/yaml"
	"github.com/BurntSushi/toml"
	"github.com/gobwas/glob"
	"github.com/golang/protobuf/ptypes/any"
)
type Files map[string][]byte
func NewFiles(from []*any.Any) Files {
	files := map[string][]byte{}
	for _, f := range from {
		files[f.TypeUrl] = f.Value
	}
	return files
}
func (f Files) GetBytes(name string) []byte {
	v, ok := f[name]
	if !ok {
		return []byte{}
	}
	return v
}
func (f Files) Get(name string) string {
	return string(f.GetBytes(name))
}
func (f Files) Glob(pattern string) Files {
	g, err := glob.Compile(pattern, '/')
	if err != nil {
		g, _ = glob.Compile("**")
	}
	nf := NewFiles(nil)
	for name, contents := range f {
		if g.Match(name) {
			nf[name] = contents
		}
	}
	return nf
}
func (f Files) AsConfig() string {
	if f == nil {
		return ""
	}
	m := map[string]string{}
	for k, v := range f {
		m[path.Base(k)] = string(v)
	}
	return ToYaml(m)
}
func (f Files) AsSecrets() string {
	if f == nil {
		return ""
	}
	m := map[string]string{}
	for k, v := range f {
		m[path.Base(k)] = base64.StdEncoding.EncodeToString(v)
	}
	return ToYaml(m)
}
func (f Files) Lines(path string) []string {
	if f == nil || f[path] == nil {
		return []string{}
	}
	return strings.Split(string(f[path]), "\n")
}