Fix issue with kyaml json unmarshalling

This commit is contained in:
Morten Torkildsen
2020-04-04 18:42:15 -07:00
parent 0f3d5c80e4
commit 022805b56b
2 changed files with 60 additions and 13 deletions

View File

@@ -697,7 +697,17 @@ func (rn *RNode) MarshalJSON() ([]byte, error) {
}
func (rn *RNode) UnmarshalJSON(b []byte) error {
r, err := Parse(string(b))
m := map[string]interface{}{}
if err := json.Unmarshal(b, &m); err != nil {
return err
}
c, err := Marshal(m)
if err != nil {
return err
}
r, err := Parse(string(c))
if err != nil {
return err
}