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:
@@ -20,12 +20,12 @@ import (
|
||||
"context"
|
||||
"testing"
|
||||
|
||||
"github.com/google/go-cmp/cmp"
|
||||
rbacv1 "k8s.io/api/rbac/v1"
|
||||
"k8s.io/apimachinery/pkg/api/equality"
|
||||
"k8s.io/apimachinery/pkg/api/errors"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
"k8s.io/apimachinery/pkg/util/diff"
|
||||
"k8s.io/apimachinery/pkg/util/yaml"
|
||||
rbacv1ac "k8s.io/client-go/applyconfigurations/rbac/v1"
|
||||
fakeclient "k8s.io/client-go/kubernetes/fake"
|
||||
@@ -215,7 +215,7 @@ func TestSyncClusterRole(t *testing.T) {
|
||||
t.Fatalf("error unmarshalling apply request: %v", err)
|
||||
}
|
||||
if !equality.Semantic.DeepEqual(ac, test.expectedClusterRoleApply) {
|
||||
t.Fatalf("%v", diff.ObjectDiff(test.expectedClusterRoleApply, ac))
|
||||
t.Fatalf("%v", cmp.Diff(test.expectedClusterRoleApply, ac))
|
||||
}
|
||||
if expectedActions == 2 {
|
||||
action := fakeClient.Actions()[1]
|
||||
@@ -227,7 +227,7 @@ func TestSyncClusterRole(t *testing.T) {
|
||||
t.Fatalf("unexpected action %#v", action)
|
||||
}
|
||||
if !equality.Semantic.DeepEqual(updateAction.GetObject().(*rbacv1.ClusterRole), test.expectedClusterRole) {
|
||||
t.Fatalf("%v", diff.ObjectDiff(test.expectedClusterRole, updateAction.GetObject().(*rbacv1.ClusterRole)))
|
||||
t.Fatalf("%v", cmp.Diff(test.expectedClusterRole, updateAction.GetObject().(*rbacv1.ClusterRole)))
|
||||
}
|
||||
}
|
||||
})
|
||||
|
Reference in New Issue
Block a user