Don't swallow error in SM patch and use new RNode Map method.

This commit is contained in:
monopole
2021-01-09 06:57:29 -08:00
parent 1a002005c1
commit c2fbb709da
5 changed files with 26 additions and 19 deletions

View File

@@ -163,12 +163,7 @@ func (wn *WNode) GetString(path string) (string, error) {
// Map implements ifc.Kunstructured.
func (wn *WNode) Map() map[string]interface{} {
var result map[string]interface{}
if err := wn.node.YNode().Decode(&result); err != nil {
// Log and die since interface doesn't allow error.
log.Fatalf("failed to decode ynode: %v", err)
}
return result
return wn.node.Map()
}
// MarshalJSON implements ifc.Kunstructured.