Merge pull request #6758 from icanhazbroccoli/icanhazbroccoli/revert-f94bac064

Revert "chartutil.ReadValues is forced to unmarshal numbers into json.Number"
pull/6756/head
Matthew Fisher 5 years ago committed by GitHub
commit 33338eab17
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -10,4 +10,3 @@ water:
water:
where: "everywhere"
nor: "any drop to drink"
temperature: 1234567890

@ -17,7 +17,6 @@ limitations under the License.
package chartutil
import (
"encoding/json"
"fmt"
"io"
"io/ioutil"
@ -106,10 +105,7 @@ func tableLookup(v Values, simple string) (Values, error) {
// ReadValues will parse YAML byte data into a Values.
func ReadValues(data []byte) (vals Values, err error) {
err = yaml.Unmarshal(data, &vals, func(d *json.Decoder) *json.Decoder {
d.UseNumber()
return d
})
err = yaml.Unmarshal(data, &vals)
if len(vals) == 0 {
vals = Values{}
}

@ -45,7 +45,6 @@ water:
water:
where: "everywhere"
nor: "any drop to drink"
temperature: 1234567890
`
data, err := ReadValues([]byte(doc))
@ -246,12 +245,6 @@ func matchValues(t *testing.T, data map[string]interface{}) {
} else if o != "everywhere" {
t.Errorf("Expected water water everywhere")
}
if o, err := ttpl("{{.water.water.temperature}}", data); err != nil {
t.Errorf(".water.water.temperature: %s", err)
} else if o != "1234567890" {
t.Errorf("Expected water water temperature: 1234567890, got: %s", o)
}
}
func ttpl(tpl string, v map[string]interface{}) (string, error) {

Loading…
Cancel
Save