mirror of
https://github.com/kubernetes/client-go.git
synced 2025-09-23 20:17:15 +00:00
Replace uses of diff.ObjectDiff with cmp.Diff
ObjectDiff is already a shim over cmp.Diff, so no actual output or behavior changes Kubernetes-commit: 29c0b73d640b6e50c4f2dfeee7b07ca66a530dbd
This commit is contained in:
committed by
Kubernetes Publisher
parent
8005e0d28b
commit
7114041b4f
@@ -21,12 +21,12 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/google/go-cmp/cmp"
|
||||
"k8s.io/apimachinery/pkg/api/equality"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
"k8s.io/apimachinery/pkg/util/diff"
|
||||
"k8s.io/client-go/dynamic/dynamicinformer"
|
||||
"k8s.io/client-go/dynamic/fake"
|
||||
"k8s.io/client-go/tools/cache"
|
||||
@@ -118,7 +118,7 @@ func TestFilteredDynamicSharedInformerFactory(t *testing.T) {
|
||||
t.Errorf("informer received an object for namespace %s when watching namespace %s", ts.ns, ts.informNS)
|
||||
}
|
||||
if !equality.Semantic.DeepEqual(testObject, objFromInformer) {
|
||||
t.Fatalf("%v", diff.ObjectDiff(testObject, objFromInformer))
|
||||
t.Fatalf("%v", cmp.Diff(testObject, objFromInformer))
|
||||
}
|
||||
case <-ctx.Done():
|
||||
if ts.ns == ts.informNS {
|
||||
@@ -239,7 +239,7 @@ func TestDynamicSharedInformerFactory(t *testing.T) {
|
||||
select {
|
||||
case objFromInformer := <-informerReciveObjectCh:
|
||||
if !equality.Semantic.DeepEqual(testObject, objFromInformer) {
|
||||
t.Fatalf("%v", diff.ObjectDiff(testObject, objFromInformer))
|
||||
t.Fatalf("%v", cmp.Diff(testObject, objFromInformer))
|
||||
}
|
||||
case <-ctx.Done():
|
||||
t.Errorf("tested informer haven't received an object, waited %v", timeout)
|
||||
|
Reference in New Issue
Block a user