mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-04 23:17:50 +00:00
cmd/kube-controller-manager
This commit is contained in:
@@ -21,6 +21,7 @@ import (
|
||||
|
||||
"k8s.io/kubernetes/pkg/api"
|
||||
"k8s.io/kubernetes/pkg/api/unversioned"
|
||||
"k8s.io/kubernetes/pkg/api/v1"
|
||||
"k8s.io/kubernetes/pkg/controller"
|
||||
"k8s.io/kubernetes/pkg/runtime"
|
||||
"k8s.io/kubernetes/pkg/util/intstr"
|
||||
@@ -45,13 +46,13 @@ func TestPodReplenishmentUpdateFunc(t *testing.T) {
|
||||
ReplenishmentFunc: mockReplenish.Replenish,
|
||||
ResyncPeriod: controller.NoResyncPeriodFunc,
|
||||
}
|
||||
oldPod := &api.Pod{
|
||||
ObjectMeta: api.ObjectMeta{Namespace: "test", Name: "pod"},
|
||||
Status: api.PodStatus{Phase: api.PodRunning},
|
||||
oldPod := &v1.Pod{
|
||||
ObjectMeta: v1.ObjectMeta{Namespace: "test", Name: "pod"},
|
||||
Status: v1.PodStatus{Phase: v1.PodRunning},
|
||||
}
|
||||
newPod := &api.Pod{
|
||||
ObjectMeta: api.ObjectMeta{Namespace: "test", Name: "pod"},
|
||||
Status: api.PodStatus{Phase: api.PodFailed},
|
||||
newPod := &v1.Pod{
|
||||
ObjectMeta: v1.ObjectMeta{Namespace: "test", Name: "pod"},
|
||||
Status: v1.PodStatus{Phase: v1.PodFailed},
|
||||
}
|
||||
updateFunc := PodReplenishmentUpdateFunc(&options)
|
||||
updateFunc(oldPod, newPod)
|
||||
@@ -70,9 +71,9 @@ func TestObjectReplenishmentDeleteFunc(t *testing.T) {
|
||||
ReplenishmentFunc: mockReplenish.Replenish,
|
||||
ResyncPeriod: controller.NoResyncPeriodFunc,
|
||||
}
|
||||
oldPod := &api.Pod{
|
||||
ObjectMeta: api.ObjectMeta{Namespace: "test", Name: "pod"},
|
||||
Status: api.PodStatus{Phase: api.PodRunning},
|
||||
oldPod := &v1.Pod{
|
||||
ObjectMeta: v1.ObjectMeta{Namespace: "test", Name: "pod"},
|
||||
Status: v1.PodStatus{Phase: v1.PodRunning},
|
||||
}
|
||||
deleteFunc := ObjectReplenishmentDeleteFunc(&options)
|
||||
deleteFunc(oldPod)
|
||||
@@ -91,21 +92,21 @@ func TestServiceReplenishmentUpdateFunc(t *testing.T) {
|
||||
ReplenishmentFunc: mockReplenish.Replenish,
|
||||
ResyncPeriod: controller.NoResyncPeriodFunc,
|
||||
}
|
||||
oldService := &api.Service{
|
||||
ObjectMeta: api.ObjectMeta{Namespace: "test", Name: "mysvc"},
|
||||
Spec: api.ServiceSpec{
|
||||
Type: api.ServiceTypeNodePort,
|
||||
Ports: []api.ServicePort{{
|
||||
oldService := &v1.Service{
|
||||
ObjectMeta: v1.ObjectMeta{Namespace: "test", Name: "mysvc"},
|
||||
Spec: v1.ServiceSpec{
|
||||
Type: v1.ServiceTypeNodePort,
|
||||
Ports: []v1.ServicePort{{
|
||||
Port: 80,
|
||||
TargetPort: intstr.FromInt(80),
|
||||
}},
|
||||
},
|
||||
}
|
||||
newService := &api.Service{
|
||||
ObjectMeta: api.ObjectMeta{Namespace: "test", Name: "mysvc"},
|
||||
Spec: api.ServiceSpec{
|
||||
Type: api.ServiceTypeClusterIP,
|
||||
Ports: []api.ServicePort{{
|
||||
newService := &v1.Service{
|
||||
ObjectMeta: v1.ObjectMeta{Namespace: "test", Name: "mysvc"},
|
||||
Spec: v1.ServiceSpec{
|
||||
Type: v1.ServiceTypeClusterIP,
|
||||
Ports: []v1.ServicePort{{
|
||||
Port: 80,
|
||||
TargetPort: intstr.FromInt(80),
|
||||
}}},
|
||||
@@ -125,21 +126,21 @@ func TestServiceReplenishmentUpdateFunc(t *testing.T) {
|
||||
ReplenishmentFunc: mockReplenish.Replenish,
|
||||
ResyncPeriod: controller.NoResyncPeriodFunc,
|
||||
}
|
||||
oldService = &api.Service{
|
||||
ObjectMeta: api.ObjectMeta{Namespace: "test", Name: "mysvc"},
|
||||
Spec: api.ServiceSpec{
|
||||
Type: api.ServiceTypeNodePort,
|
||||
Ports: []api.ServicePort{{
|
||||
oldService = &v1.Service{
|
||||
ObjectMeta: v1.ObjectMeta{Namespace: "test", Name: "mysvc"},
|
||||
Spec: v1.ServiceSpec{
|
||||
Type: v1.ServiceTypeNodePort,
|
||||
Ports: []v1.ServicePort{{
|
||||
Port: 80,
|
||||
TargetPort: intstr.FromInt(80),
|
||||
}},
|
||||
},
|
||||
}
|
||||
newService = &api.Service{
|
||||
ObjectMeta: api.ObjectMeta{Namespace: "test", Name: "mysvc"},
|
||||
Spec: api.ServiceSpec{
|
||||
Type: api.ServiceTypeNodePort,
|
||||
Ports: []api.ServicePort{{
|
||||
newService = &v1.Service{
|
||||
ObjectMeta: v1.ObjectMeta{Namespace: "test", Name: "mysvc"},
|
||||
Spec: v1.ServiceSpec{
|
||||
Type: v1.ServiceTypeNodePort,
|
||||
Ports: []v1.ServicePort{{
|
||||
Port: 81,
|
||||
TargetPort: intstr.FromInt(81),
|
||||
}}},
|
||||
|
||||
Reference in New Issue
Block a user