fix(chartutil): fix nil error on values

Fixes: https://github.com/kubernetes/helm/issues/803
pull/805/head
Adam Reese 8 years ago
parent 9fdb9eebcf
commit d95a144563

@ -65,10 +65,12 @@ func tableLookup(v Values, simple string) (Values, error) {
}
// ReadValues will parse YAML byte data into a Values.
func ReadValues(data []byte) (Values, error) {
out := map[string]interface{}{}
err := yaml.Unmarshal(data, &out)
return out, err
func ReadValues(data []byte) (vals Values, err error) {
vals = make(map[string]interface{})
if len(data) > 0 {
err = yaml.Unmarshal(data, &vals)
}
return
}
// ReadValuesFile will parse a YAML file into a Values.

@ -53,6 +53,10 @@ func TestRender(t *testing.T) {
if out["test1"] != expect {
t.Errorf("Expected %q, got %q", expect, out["test1"])
}
if _, err := e.Render(c, &chart.Config{}, overrides); err != nil {
t.Errorf("Unexpected error: %s", err)
}
}
func TestRenderInternals(t *testing.T) {

Loading…
Cancel
Save