mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-17 15:13:08 +00:00
Update more packages, tests, binaries for quantity
make etcd registry pass test fix kubelet config for quantity fix openstack for quantity fix controller for quantity fix last tests for quantity wire into binaries fix controller manager fix build for 32 bit systems
This commit is contained in:
@@ -17,7 +17,6 @@ limitations under the License.
|
||||
package config
|
||||
|
||||
import (
|
||||
"reflect"
|
||||
"sort"
|
||||
"testing"
|
||||
|
||||
@@ -65,13 +64,7 @@ func CreateValidPod(name, namespace, source string) api.BoundPod {
|
||||
}
|
||||
|
||||
func CreatePodUpdate(op kubelet.PodOperation, source string, pods ...api.BoundPod) kubelet.PodUpdate {
|
||||
// We deliberately return an empty slice instead of a nil pointer here
|
||||
// because reflect.DeepEqual differentiates between the two and we need to
|
||||
// pick one for consistency.
|
||||
newPods := make([]api.BoundPod, len(pods))
|
||||
if len(pods) == 0 {
|
||||
return kubelet.PodUpdate{newPods, op, source}
|
||||
}
|
||||
for i := range pods {
|
||||
newPods[i] = pods[i]
|
||||
}
|
||||
@@ -89,7 +82,7 @@ func expectPodUpdate(t *testing.T, ch <-chan kubelet.PodUpdate, expected ...kube
|
||||
for i := range expected {
|
||||
update := <-ch
|
||||
sort.Sort(sortedPods(update.Pods))
|
||||
if !reflect.DeepEqual(expected[i], update) {
|
||||
if !api.Semantic.DeepEqual(expected[i], update) {
|
||||
t.Fatalf("Expected %#v, Got %#v", expected[i], update)
|
||||
}
|
||||
}
|
||||
|
@@ -20,7 +20,6 @@ import (
|
||||
"encoding/json"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"reflect"
|
||||
"sort"
|
||||
"testing"
|
||||
"time"
|
||||
@@ -130,7 +129,7 @@ func TestReadFromFile(t *testing.T) {
|
||||
Containers: []api.Container{{Image: "test/image", TerminationMessagePath: "/dev/termination-log"}},
|
||||
},
|
||||
})
|
||||
if !reflect.DeepEqual(expected, update) {
|
||||
if !api.Semantic.DeepEqual(expected, update) {
|
||||
t.Fatalf("Expected %#v, Got %#v", expected, update)
|
||||
}
|
||||
|
||||
@@ -171,7 +170,7 @@ func TestExtractFromValidDataFile(t *testing.T) {
|
||||
}
|
||||
update := (<-ch).(kubelet.PodUpdate)
|
||||
expected := CreatePodUpdate(kubelet.SET, kubelet.FileSource, expectedPod)
|
||||
if !reflect.DeepEqual(expected, update) {
|
||||
if !api.Semantic.DeepEqual(expected, update) {
|
||||
t.Errorf("Expected %#v, Got %#v", expected, update)
|
||||
}
|
||||
}
|
||||
@@ -192,7 +191,7 @@ func TestExtractFromEmptyDir(t *testing.T) {
|
||||
|
||||
update := (<-ch).(kubelet.PodUpdate)
|
||||
expected := CreatePodUpdate(kubelet.SET, kubelet.FileSource)
|
||||
if !reflect.DeepEqual(expected, update) {
|
||||
if !api.Semantic.DeepEqual(expected, update) {
|
||||
t.Errorf("Expected %#v, Got %#v", expected, update)
|
||||
}
|
||||
}
|
||||
@@ -242,7 +241,7 @@ func TestExtractFromDir(t *testing.T) {
|
||||
expected := CreatePodUpdate(kubelet.SET, kubelet.FileSource, pods...)
|
||||
sort.Sort(sortedPods(update.Pods))
|
||||
sort.Sort(sortedPods(expected.Pods))
|
||||
if !reflect.DeepEqual(expected, update) {
|
||||
if !api.Semantic.DeepEqual(expected, update) {
|
||||
t.Fatalf("Expected %#v, Got %#v", expected, update)
|
||||
}
|
||||
for i := range update.Pods {
|
||||
|
@@ -19,7 +19,6 @@ package config
|
||||
import (
|
||||
"encoding/json"
|
||||
"net/http/httptest"
|
||||
"reflect"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
@@ -193,7 +192,7 @@ func TestExtractFromHTTP(t *testing.T) {
|
||||
continue
|
||||
}
|
||||
update := (<-ch).(kubelet.PodUpdate)
|
||||
if !reflect.DeepEqual(testCase.expected, update) {
|
||||
if !api.Semantic.DeepEqual(testCase.expected, update) {
|
||||
t.Errorf("%s: Expected: %#v, Got: %#v", testCase.desc, testCase.expected, update)
|
||||
}
|
||||
for i := range update.Pods {
|
||||
|
Reference in New Issue
Block a user