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
bb5d2101
Commit
bb5d2101
authored
Jun 15, 2015
by
Fabio Yeon
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #9765 from brendandburns/fix-kubelet
Fix a bug where the network container could be torn down before other pods
parents
3f62e420
aac696d4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
8 deletions
+17
-8
manager.go
pkg/kubelet/dockertools/manager.go
+17
-8
No files found.
pkg/kubelet/dockertools/manager.go
View file @
bb5d2101
...
...
@@ -1041,29 +1041,38 @@ func (dm *DockerManager) KillPod(pod kubecontainer.Pod) error {
// can be Len errors + the networkPlugin teardown error.
errs
:=
make
(
chan
error
,
len
(
pod
.
Containers
)
+
1
)
wg
:=
sync
.
WaitGroup
{}
var
networkID
types
.
UID
for
_
,
container
:=
range
pod
.
Containers
{
wg
.
Add
(
1
)
go
func
(
container
*
kubecontainer
.
Container
)
{
defer
util
.
HandleCrash
()
defer
wg
.
Done
()
// TODO: Handle this without signaling the pod infra container to
// adapt to the generic container runtime.
if
container
.
Name
==
PodInfraContainerName
{
err
:=
dm
.
networkPlugin
.
TearDownPod
(
pod
.
Namespace
,
pod
.
Name
,
kubeletTypes
.
DockerID
(
container
.
ID
))
if
err
!=
nil
{
glog
.
Errorf
(
"Failed tearing down the infra container: %v"
,
err
)
errs
<-
err
}
// Store the container runtime for later deletion.
// We do this so that PreStop handlers can run in the network namespace.
networkID
=
container
.
ID
return
}
err
:=
dm
.
killContainer
(
container
.
ID
)
if
err
!=
nil
{
if
err
:=
dm
.
killContainer
(
container
.
ID
);
err
!=
nil
{
glog
.
Errorf
(
"Failed to delete container: %v; Skipping pod %q"
,
err
,
pod
.
ID
)
errs
<-
err
}
wg
.
Done
()
}(
container
)
}
wg
.
Wait
()
if
len
(
networkID
)
>
0
{
if
err
:=
dm
.
networkPlugin
.
TearDownPod
(
pod
.
Namespace
,
pod
.
Name
,
kubeletTypes
.
DockerID
(
networkID
));
err
!=
nil
{
glog
.
Errorf
(
"Failed tearing down the infra container: %v"
,
err
)
errs
<-
err
}
if
err
:=
dm
.
killContainer
(
networkID
);
err
!=
nil
{
glog
.
Errorf
(
"Failed to delete container: %v; Skipping pod %q"
,
err
,
pod
.
ID
)
errs
<-
err
}
}
close
(
errs
)
if
len
(
errs
)
>
0
{
errList
:=
[]
error
{}
...
...
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