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)
}
AsSecrets returns the base64-encoded value of a Files object suitable for
including in the 'data' section of a Kubernetes Secret definition.
Duplicate keys will be overwritten, so be aware that your file names
(regardless of path) should be unique.

This is designed to be called from a template, and will return empty string
(via ToYaml function) if it cannot be serialized to YAML, or if the Files
object is nil.

The output will not be indented, so you will want to pipe this to the
'indent' template function.

data:
{{ .Files.Glob("secrets/*").AsSecrets() }}
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)
}