mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-05 15:37:24 +00:00
Split the Kubelet flag options and struct
Reduces the size of the app/server.go file and ensures that the flags and their defaults are clearly separated.
This commit is contained in:
@@ -189,7 +189,7 @@ func TestExecSupportNotExists(t *testing.T) {
|
||||
|
||||
func TestDockerContainerCommand(t *testing.T) {
|
||||
runner := &DockerManager{}
|
||||
containerID := kubetypes.DockerID("1234").ContainerID()
|
||||
containerID := kubecontainer.DockerID("1234").ContainerID()
|
||||
command := []string{"ls"}
|
||||
cmd, _ := runner.getRunInContainerCommand(containerID, command)
|
||||
if cmd.Dir != "/var/lib/docker/execdriver/native/"+containerID.ID {
|
||||
@@ -578,13 +578,13 @@ func TestFindContainersByPod(t *testing.T) {
|
||||
Namespace: "ns",
|
||||
Containers: []*kubecontainer.Container{
|
||||
{
|
||||
ID: kubetypes.DockerID("foobar").ContainerID(),
|
||||
ID: kubecontainer.DockerID("foobar").ContainerID(),
|
||||
Name: "foobar",
|
||||
Hash: 0x1234,
|
||||
State: kubecontainer.ContainerStateUnknown,
|
||||
},
|
||||
{
|
||||
ID: kubetypes.DockerID("baz").ContainerID(),
|
||||
ID: kubecontainer.DockerID("baz").ContainerID(),
|
||||
Name: "baz",
|
||||
Hash: 0x1234,
|
||||
State: kubecontainer.ContainerStateUnknown,
|
||||
@@ -597,7 +597,7 @@ func TestFindContainersByPod(t *testing.T) {
|
||||
Namespace: "ns",
|
||||
Containers: []*kubecontainer.Container{
|
||||
{
|
||||
ID: kubetypes.DockerID("barbar").ContainerID(),
|
||||
ID: kubecontainer.DockerID("barbar").ContainerID(),
|
||||
Name: "barbar",
|
||||
Hash: 0x1234,
|
||||
State: kubecontainer.ContainerStateUnknown,
|
||||
@@ -639,19 +639,19 @@ func TestFindContainersByPod(t *testing.T) {
|
||||
Namespace: "ns",
|
||||
Containers: []*kubecontainer.Container{
|
||||
{
|
||||
ID: kubetypes.DockerID("foobar").ContainerID(),
|
||||
ID: kubecontainer.DockerID("foobar").ContainerID(),
|
||||
Name: "foobar",
|
||||
Hash: 0x1234,
|
||||
State: kubecontainer.ContainerStateUnknown,
|
||||
},
|
||||
{
|
||||
ID: kubetypes.DockerID("barfoo").ContainerID(),
|
||||
ID: kubecontainer.DockerID("barfoo").ContainerID(),
|
||||
Name: "barfoo",
|
||||
Hash: 0x1234,
|
||||
State: kubecontainer.ContainerStateUnknown,
|
||||
},
|
||||
{
|
||||
ID: kubetypes.DockerID("baz").ContainerID(),
|
||||
ID: kubecontainer.DockerID("baz").ContainerID(),
|
||||
Name: "baz",
|
||||
Hash: 0x1234,
|
||||
State: kubecontainer.ContainerStateUnknown,
|
||||
@@ -664,7 +664,7 @@ func TestFindContainersByPod(t *testing.T) {
|
||||
Namespace: "ns",
|
||||
Containers: []*kubecontainer.Container{
|
||||
{
|
||||
ID: kubetypes.DockerID("barbar").ContainerID(),
|
||||
ID: kubecontainer.DockerID("barbar").ContainerID(),
|
||||
Name: "barbar",
|
||||
Hash: 0x1234,
|
||||
State: kubecontainer.ContainerStateUnknown,
|
||||
@@ -677,7 +677,7 @@ func TestFindContainersByPod(t *testing.T) {
|
||||
Namespace: "ns",
|
||||
Containers: []*kubecontainer.Container{
|
||||
{
|
||||
ID: kubetypes.DockerID("bazbaz").ContainerID(),
|
||||
ID: kubecontainer.DockerID("bazbaz").ContainerID(),
|
||||
Name: "bazbaz",
|
||||
Hash: 0x1234,
|
||||
State: kubecontainer.ContainerStateUnknown,
|
||||
@@ -696,7 +696,7 @@ func TestFindContainersByPod(t *testing.T) {
|
||||
fakeClient := &FakeDockerClient{}
|
||||
np, _ := network.InitNetworkPlugin([]network.NetworkPlugin{}, "", network.NewFakeHost(nil))
|
||||
// image back-off is set to nil, this test shouldnt pull images
|
||||
containerManager := NewFakeDockerManager(fakeClient, &record.FakeRecorder{}, nil, nil, &cadvisorapi.MachineInfo{}, PodInfraContainerImage, 0, 0, "", kubecontainer.FakeOS{}, np, nil, nil, nil)
|
||||
containerManager := NewFakeDockerManager(fakeClient, &record.FakeRecorder{}, nil, nil, &cadvisorapi.MachineInfo{}, kubetypes.PodInfraContainerImage, 0, 0, "", kubecontainer.FakeOS{}, np, nil, nil, nil)
|
||||
for i, test := range tests {
|
||||
fakeClient.ContainerList = test.containerList
|
||||
fakeClient.ExitedContainerList = test.exitedContainerList
|
||||
|
||||
Reference in New Issue
Block a user