Replace uses of ObjectGoPrintDiff with cmp.Diff

ObjectGoPrintDiff is already a shim over cmp.Diff, so no actual output
or behavior changes

Kubernetes-commit: 9627c50ef37f3b5274486e6f5ad37b73b1b69bf0
This commit is contained in:
Tim Hockin
2023-03-23 11:31:25 -07:00
committed by Kubernetes Publisher
parent 7114041b4f
commit c4339eeca9
3 changed files with 11 additions and 12 deletions

View File

@@ -23,9 +23,9 @@ import (
"testing"
"time"
"github.com/google/go-cmp/cmp"
v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/diff"
testclocks "k8s.io/utils/clock/testing"
)
@@ -121,7 +121,7 @@ func validateEvent(messagePrefix string, actualEvent *v1.Event, expectedEvent *v
}
recvEvent.Name = expectedEvent.Name
if e, a := expectedEvent, &recvEvent; !reflect.DeepEqual(e, a) {
t.Errorf("%v - diff: %s", messagePrefix, diff.ObjectGoPrintDiff(e, a))
t.Errorf("%v - diff: %s", messagePrefix, cmp.Diff(e, a))
}
recvEvent.FirstTimestamp = actualFirstTimestamp
recvEvent.LastTimestamp = actualLastTimestamp