Replace uses of diff.ObjectDiff with cmp.Diff

ObjectDiff is already a shim over cmp.Diff, so no actual output or
behavior changes
This commit is contained in:
Tim Hockin
2023-03-23 11:29:01 -07:00
parent dd7af241c1
commit 29c0b73d64
55 changed files with 170 additions and 168 deletions

View File

@@ -21,9 +21,9 @@ import (
"reflect"
"testing"
"github.com/google/go-cmp/cmp"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/fields"
"k8s.io/apimachinery/pkg/util/diff"
apitesting "k8s.io/kubernetes/pkg/api/testing"
api "k8s.io/kubernetes/pkg/apis/core"
@@ -67,7 +67,7 @@ func TestGetAttrs(t *testing.T) {
"type": api.EventTypeNormal,
}
if e, a := expectA, field; !reflect.DeepEqual(e, a) {
t.Errorf("diff: %s", diff.ObjectDiff(e, a))
t.Errorf("diff: %s", cmp.Diff(e, a))
}
eventB := &api.Event{
@@ -105,7 +105,7 @@ func TestGetAttrs(t *testing.T) {
"type": api.EventTypeNormal,
}
if e, a := expectB, field; !reflect.DeepEqual(e, a) {
t.Errorf("diff: %s", diff.ObjectDiff(e, a))
t.Errorf("diff: %s", cmp.Diff(e, a))
}
}