Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
b00e82ed
Commit
b00e82ed
authored
Mar 13, 2015
by
Victor Marmol
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #5466 from dchen1107/docker
Fix a regression introduced lately: When any given PodInfraContainer on ...
parents
ce7658a3
732d4cb2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
6 deletions
+27
-6
docker.go
pkg/kubelet/dockertools/docker.go
+0
-1
kubelet_test.go
pkg/kubelet/kubelet_test.go
+27
-5
No files found.
pkg/kubelet/dockertools/docker.go
View file @
b00e82ed
...
...
@@ -423,7 +423,6 @@ func (c DockerContainers) RemoveContainerWithID(containerID DockerID) {
// FindContainersByPod returns the containers that belong to the pod.
func
(
c
DockerContainers
)
FindContainersByPod
(
podUID
types
.
UID
,
podFullName
string
)
DockerContainers
{
containers
:=
make
(
DockerContainers
)
for
_
,
dockerContainer
:=
range
c
{
if
len
(
dockerContainer
.
Names
)
==
0
{
continue
...
...
pkg/kubelet/kubelet_test.go
View file @
b00e82ed
...
...
@@ -712,25 +712,47 @@ func TestSyncPodsDeletesWithNoPodInfraContainer(t *testing.T) {
fakeDocker
.
ContainerList
=
[]
docker
.
APIContainers
{
{
// format is // k8s_<container-id>_<pod-fullname>_<pod-uid>
Names
:
[]
string
{
"/k8s_bar
_foo
_new_12345678_0"
},
Names
:
[]
string
{
"/k8s_bar
1_foo1
_new_12345678_0"
},
ID
:
"1234"
,
},
{
// format is // k8s_<container-id>_<pod-fullname>_<pod-uid>
Names
:
[]
string
{
"/k8s_bar2_foo2_new_87654321_0"
},
ID
:
"5678"
,
},
{
// format is // k8s_<container-id>_<pod-fullname>_<pod-uid>
Names
:
[]
string
{
"/k8s_POD_foo2_new_87654321_0"
},
ID
:
"8765"
,
},
}
kubelet
.
pods
=
[]
api
.
BoundPod
{
{
ObjectMeta
:
api
.
ObjectMeta
{
UID
:
"12345678"
,
Name
:
"foo"
,
Name
:
"foo
1
"
,
Namespace
:
"new"
,
},
Spec
:
api
.
PodSpec
{
Containers
:
[]
api
.
Container
{
{
Name
:
"bar"
},
{
Name
:
"bar1"
},
},
},
},
{
ObjectMeta
:
api
.
ObjectMeta
{
UID
:
"87654321"
,
Name
:
"foo2"
,
Namespace
:
"new"
,
},
Spec
:
api
.
PodSpec
{
Containers
:
[]
api
.
Container
{
{
Name
:
"bar2"
},
},
},
},
}
waitGroup
.
Add
(
1
)
waitGroup
.
Add
(
2
)
err
:=
kubelet
.
SyncPods
(
kubelet
.
pods
,
emptyPodUIDs
,
time
.
Now
())
if
err
!=
nil
{
t
.
Errorf
(
"unexpected error: %v"
,
err
)
...
...
@@ -738,7 +760,7 @@ func TestSyncPodsDeletesWithNoPodInfraContainer(t *testing.T) {
waitGroup
.
Wait
()
verifyCalls
(
t
,
fakeDocker
,
[]
string
{
"list"
,
"list"
,
"stop"
,
"create"
,
"start"
,
"inspect_container"
,
"create"
,
"start"
})
"list"
,
"list"
,
"
list"
,
"list"
,
"inspect_container"
,
"inspect_container"
,
"
stop"
,
"create"
,
"start"
,
"inspect_container"
,
"create"
,
"start"
})
// A map iteration is used to delete containers, so must not depend on
// order here.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment