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

@@ -8,6 +8,7 @@ import (
"testing"
"github.com/google/go-cmp/cmp"
"github.com/stretchr/testify/assert"
"gopkg.in/yaml.v3"
"sigs.k8s.io/kustomize/api/resid"
kyaml "sigs.k8s.io/kustomize/kyaml/yaml"
@@ -480,6 +481,10 @@ func TestGetSlice(t *testing.T) {
}
}
func TestMapEmpty(t *testing.T) {
assert.Equal(t, 0, len(NewWNode().Map()))
}
func TestMap(t *testing.T) {
wn := NewWNode()
if err := wn.UnmarshalJSON([]byte(deploymentLittleJson)); err != nil {