refactor: use metav1.ObjectMeta in other types

This commit is contained in:
Clayton Coleman
2017-01-16 22:38:19 -05:00
parent 5a5d31555b
commit 9a2a50cda7
822 changed files with 11914 additions and 9290 deletions

View File

@@ -39,6 +39,7 @@ go_test(
"//pkg/kubelet/container:go_default_library",
"//pkg/kubelet/pod/testing:go_default_library",
"//pkg/kubelet/types:go_default_library",
"//vendor:k8s.io/apimachinery/pkg/apis/meta/v1",
"//vendor:k8s.io/apimachinery/pkg/types",
],
)

View File

@@ -20,6 +20,7 @@ import (
"reflect"
"testing"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/types"
"k8s.io/kubernetes/pkg/api/v1"
podtest "k8s.io/kubernetes/pkg/kubelet/pod/testing"
@@ -37,7 +38,7 @@ func newTestManager() (*basicManager, *podtest.FakeMirrorClient) {
// methods work correctly.
func TestGetSetPods(t *testing.T) {
mirrorPod := &v1.Pod{
ObjectMeta: v1.ObjectMeta{
ObjectMeta: metav1.ObjectMeta{
UID: "987654321",
Name: "bar",
Namespace: "default",
@@ -48,7 +49,7 @@ func TestGetSetPods(t *testing.T) {
},
}
staticPod := &v1.Pod{
ObjectMeta: v1.ObjectMeta{
ObjectMeta: metav1.ObjectMeta{
UID: "123456789",
Name: "bar",
Namespace: "default",
@@ -58,7 +59,7 @@ func TestGetSetPods(t *testing.T) {
expectedPods := []*v1.Pod{
{
ObjectMeta: v1.ObjectMeta{
ObjectMeta: metav1.ObjectMeta{
UID: "999999999",
Name: "taco",
Namespace: "default",
@@ -112,7 +113,7 @@ func TestGetSetPods(t *testing.T) {
func TestDeletePods(t *testing.T) {
mirrorPod := &v1.Pod{
ObjectMeta: v1.ObjectMeta{
ObjectMeta: metav1.ObjectMeta{
UID: types.UID("mirror-pod-uid"),
Name: "mirror-static-pod-name",
Namespace: v1.NamespaceDefault,
@@ -123,7 +124,7 @@ func TestDeletePods(t *testing.T) {
},
}
staticPod := &v1.Pod{
ObjectMeta: v1.ObjectMeta{
ObjectMeta: metav1.ObjectMeta{
UID: types.UID("static-pod-uid"),
Name: "mirror-static-pod-name",
Namespace: v1.NamespaceDefault,
@@ -133,7 +134,7 @@ func TestDeletePods(t *testing.T) {
expectedPods := []*v1.Pod{
{
ObjectMeta: v1.ObjectMeta{
ObjectMeta: metav1.ObjectMeta{
UID: types.UID("extra-pod-uid"),
Name: "extra-pod-name",
Namespace: v1.NamespaceDefault,