pkg/api: move Semantic equality to k8s.io/apimachinery/pkg/api/equality

This commit is contained in:
Dr. Stefan Schimanski
2017-01-25 14:39:54 +01:00
committed by Dr. Stefan Schimanski
parent 88d9829ad5
commit 79adb99a13
64 changed files with 261 additions and 165 deletions

View File

@@ -29,6 +29,7 @@ import (
"testing"
"time"
apiequality "k8s.io/apimachinery/pkg/api/equality"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/types"
@@ -58,7 +59,7 @@ func TestUpdateOnNonExistentFile(t *testing.T) {
case got := <-ch:
update := got.(kubetypes.PodUpdate)
expected := CreatePodUpdate(kubetypes.SET, kubetypes.FileSource)
if !api.Semantic.DeepDerivative(expected, update) {
if !apiequality.Semantic.DeepDerivative(expected, update) {
t.Fatalf("expected %#v, Got %#v", expected, update)
}
@@ -95,7 +96,7 @@ func TestReadPodsFromFileExistAlready(t *testing.T) {
t.Fatalf("%s: Invalid pod %#v, %#v", testCase.desc, internalPod, errs)
}
}
if !api.Semantic.DeepEqual(testCase.expected, update) {
if !apiequality.Semantic.DeepEqual(testCase.expected, update) {
t.Fatalf("%s: Expected %#v, Got %#v", testCase.desc, testCase.expected, update)
}
case <-time.After(wait.ForeverTestTimeout):
@@ -159,7 +160,7 @@ func TestExtractFromEmptyDir(t *testing.T) {
update := (<-ch).(kubetypes.PodUpdate)
expected := CreatePodUpdate(kubetypes.SET, kubetypes.FileSource)
if !api.Semantic.DeepEqual(expected, update) {
if !apiequality.Semantic.DeepEqual(expected, update) {
t.Fatalf("expected %#v, Got %#v", expected, update)
}
}
@@ -375,7 +376,7 @@ func expectUpdate(t *testing.T, ch chan interface{}, testCase *testCase) {
}
}
if !api.Semantic.DeepEqual(testCase.expected, update) {
if !apiequality.Semantic.DeepEqual(testCase.expected, update) {
t.Fatalf("%s: Expected: %#v, Got: %#v", testCase.desc, testCase.expected, update)
}
return