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
e2e35696
Commit
e2e35696
authored
Sep 12, 2017
by
Balaji Subramaniam
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make CPU manager release allocated CPUs when container enters completed phase.
parent
a63e3dee
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
0 deletions
+11
-0
kuberuntime_manager.go
pkg/kubelet/kuberuntime/kuberuntime_manager.go
+11
-0
No files found.
pkg/kubelet/kuberuntime/kuberuntime_manager.go
View file @
e2e35696
...
...
@@ -474,6 +474,17 @@ func (m *kubeGenericRuntimeManager) computePodActions(pod *v1.Pod, podStatus *ku
// check the status of containers.
for
idx
,
container
:=
range
pod
.
Spec
.
Containers
{
containerStatus
:=
podStatus
.
FindContainerStatusByName
(
container
.
Name
)
// Call internal container post-stop lifecycle hook for any non-running container so that any
// allocated cpus are released immediately. If the container is restarted, cpus will be re-allocated
// to it.
if
containerStatus
!=
nil
&&
containerStatus
.
State
!=
kubecontainer
.
ContainerStateRunning
{
if
err
:=
m
.
internalLifecycle
.
PostStopContainer
(
containerStatus
.
ID
.
ID
);
err
!=
nil
{
glog
.
Errorf
(
"internal container post-stop lifecycle hook failed for container %v in pod %v with error %v"
,
container
.
Name
,
pod
.
Name
,
err
)
}
}
// If container does not exist, or is not running, check whether we
// need to restart it.
if
containerStatus
==
nil
||
containerStatus
.
State
!=
kubecontainer
.
ContainerStateRunning
{
...
...
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