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
72708d74
Commit
72708d74
authored
Apr 30, 2015
by
Victor Marmol
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #7605 from yifan-gu/rkt_killpod
kubelet/rkt: Add KillPod() and GetPodStatus() for rkt.
parents
03b5c325
428652bd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
0 deletions
+23
-0
rkt.go
pkg/kubelet/rkt/rkt.go
+23
-0
No files found.
pkg/kubelet/rkt/rkt.go
View file @
72708d74
...
@@ -616,3 +616,26 @@ func (r *Runtime) GetPods(all bool) ([]*kubecontainer.Pod, error) {
...
@@ -616,3 +616,26 @@ func (r *Runtime) GetPods(all bool) ([]*kubecontainer.Pod, error) {
}
}
return
pods
,
nil
return
pods
,
nil
}
}
// KillPod invokes 'systemctl kill' to kill the unit that runs the pod.
func
(
r
*
Runtime
)
KillPod
(
pod
kubecontainer
.
Pod
)
error
{
glog
.
V
(
4
)
.
Infof
(
"Rkt is killing pod: name %q."
,
pod
.
Name
)
// TODO(yifan): More graceful stop. Replace with StopUnit and wait for a timeout.
r
.
systemd
.
KillUnit
(
makePodServiceFileName
(
pod
.
ID
),
int32
(
syscall
.
SIGKILL
))
return
r
.
systemd
.
Reload
()
}
// GetPodStatus currently invokes GetPods() to return the status.
// TODO(yifan): Split the get status logic from GetPods().
func
(
r
*
Runtime
)
GetPodStatus
(
pod
*
api
.
Pod
)
(
*
api
.
PodStatus
,
error
)
{
pods
,
err
:=
r
.
GetPods
(
true
)
if
err
!=
nil
{
return
nil
,
err
}
p
:=
kubecontainer
.
Pods
(
pods
)
.
FindPodByID
(
pod
.
UID
)
if
len
(
p
.
Containers
)
==
0
{
return
nil
,
fmt
.
Errorf
(
"cannot find status for pod: %q"
,
kubecontainer
.
BuildPodFullName
(
pod
.
Name
,
pod
.
Namespace
))
}
return
&
p
.
Status
,
nil
}
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