Revert "chartutil.ReadValues is forced to unmarshal numbers into json.Number refs #1707 [dev-v3]"

This reverts commit f94bac0643.

Due to a major numeric regression detected in dev-v2 reported in #6708,
we believe the master branch (former dev-v3) is also impacted by this
change and will expose the same set of problems. In order to not
jeopardize the stability of helm3 this commit is reverted in favor of a
better fix in the future.

Signed-off-by: Oleg Sidorov <me@whitebox.io>
pull/6758/head
Oleg Sidorov 5 years ago
parent 509a8819b7
commit 44a81f63f7

@ -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