mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-28 05:36:08 +00:00
refactor: use metav1.ObjectMeta in other types
This commit is contained in:
@@ -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",
|
||||
],
|
||||
)
|
||||
|
@@ -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,
|
||||
|
Reference in New Issue
Block a user