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
6ced6624
Commit
6ced6624
authored
Aug 21, 2015
by
Yifan Gu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kubelet/dockertools: clear container reference when killing a container.
parent
00e34429
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
2 additions
and
3 deletions
+2
-3
container_reference_manager.go
pkg/kubelet/container/container_reference_manager.go
+0
-2
manager.go
pkg/kubelet/dockertools/manager.go
+1
-0
rkt.go
pkg/kubelet/rkt/rkt.go
+1
-1
No files found.
pkg/kubelet/container/container_reference_manager.go
View file @
6ced6624
...
@@ -46,8 +46,6 @@ func (c *RefManager) SetRef(id string, ref *api.ObjectReference) {
...
@@ -46,8 +46,6 @@ func (c *RefManager) SetRef(id string, ref *api.ObjectReference) {
}
}
// ClearRef forgets the given container id and its associated container reference.
// ClearRef forgets the given container id and its associated container reference.
// TODO(yifan): This is currently never called. Consider to remove this function,
// or figure out when to clear the references.
func
(
c
*
RefManager
)
ClearRef
(
id
string
)
{
func
(
c
*
RefManager
)
ClearRef
(
id
string
)
{
c
.
Lock
()
c
.
Lock
()
defer
c
.
Unlock
()
defer
c
.
Unlock
()
...
...
pkg/kubelet/dockertools/manager.go
View file @
6ced6624
...
@@ -1294,6 +1294,7 @@ func (dm *DockerManager) killContainer(containerID types.UID, container *api.Con
...
@@ -1294,6 +1294,7 @@ func (dm *DockerManager) killContainer(containerID types.UID, container *api.Con
}
else
{
}
else
{
// TODO: pass reason down here, and state, or move this call up the stack.
// TODO: pass reason down here, and state, or move this call up the stack.
dm
.
recorder
.
Eventf
(
ref
,
"Killing"
,
"Killing with docker id %v"
,
util
.
ShortenString
(
ID
,
12
))
dm
.
recorder
.
Eventf
(
ref
,
"Killing"
,
"Killing with docker id %v"
,
util
.
ShortenString
(
ID
,
12
))
dm
.
containerRefManager
.
ClearRef
(
ID
)
}
}
return
err
return
err
}
}
...
...
pkg/kubelet/rkt/rkt.go
View file @
6ced6624
...
@@ -726,6 +726,7 @@ func (r *runtime) GetPods(all bool) ([]*kubecontainer.Pod, error) {
...
@@ -726,6 +726,7 @@ func (r *runtime) GetPods(all bool) ([]*kubecontainer.Pod, error) {
}
}
// KillPod invokes 'systemctl kill' to kill the unit that runs the pod.
// KillPod invokes 'systemctl kill' to kill the unit that runs the pod.
// TODO(yifan): Handle network plugin.
func
(
r
*
runtime
)
KillPod
(
pod
*
api
.
Pod
,
runningPod
kubecontainer
.
Pod
)
error
{
func
(
r
*
runtime
)
KillPod
(
pod
*
api
.
Pod
,
runningPod
kubecontainer
.
Pod
)
error
{
glog
.
V
(
4
)
.
Infof
(
"Rkt is killing pod: name %q."
,
runningPod
.
Name
)
glog
.
V
(
4
)
.
Infof
(
"Rkt is killing pod: name %q."
,
runningPod
.
Name
)
serviceName
:=
makePodServiceFileName
(
runningPod
.
ID
)
serviceName
:=
makePodServiceFileName
(
runningPod
.
ID
)
...
@@ -948,7 +949,6 @@ func (r *runtime) SyncPod(pod *api.Pod, runningPod kubecontainer.Pod, podStatus
...
@@ -948,7 +949,6 @@ func (r *runtime) SyncPod(pod *api.Pod, runningPod kubecontainer.Pod, podStatus
}
}
if
restartPod
{
if
restartPod
{
// TODO(yifan): Handle network plugin.
if
err
:=
r
.
KillPod
(
pod
,
runningPod
);
err
!=
nil
{
if
err
:=
r
.
KillPod
(
pod
,
runningPod
);
err
!=
nil
{
return
err
return
err
}
}
...
...
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