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
cda80d68
Commit
cda80d68
authored
Dec 28, 2016
by
NickrenREN
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
optimize podSandboxChanged and fix function notes
parent
76dfee04
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
kuberuntime_manager.go
pkg/kubelet/kuberuntime/kuberuntime_manager.go
+4
-4
No files found.
pkg/kubelet/kuberuntime/kuberuntime_manager.go
View file @
cda80d68
...
...
@@ -321,7 +321,7 @@ func (m *kubeGenericRuntimeManager) GetPods(all bool) ([]*kubecontainer.Pod, err
return
result
,
nil
}
// containerToKillInfo contains nec
c
essary information to kill a container.
// containerToKillInfo contains necessary information to kill a container.
type
containerToKillInfo
struct
{
// The spec of the container.
container
*
v1
.
Container
...
...
@@ -350,7 +350,7 @@ type podContainerSpecChanges struct {
ContainersToKeep
map
[
kubecontainer
.
ContainerID
]
int
// ContainersToKill keeps a map of containers that need to be killed, note that
// the key is the container ID of the container, while
// the value contains nec
c
essary information to kill a container.
// the value contains necessary information to kill a container.
ContainersToKill
map
[
kubecontainer
.
ContainerID
]
containerToKillInfo
// InitFailed indicates whether init containers are failed.
...
...
@@ -363,7 +363,7 @@ type podContainerSpecChanges struct {
// podSandboxChanged checks whether the spec of the pod is changed and returns
// (changed, new attempt, original sandboxID if exist).
func
(
m
*
kubeGenericRuntimeManager
)
podSandboxChanged
(
pod
*
v1
.
Pod
,
podStatus
*
kubecontainer
.
PodStatus
)
(
changed
bool
,
attempt
uint32
,
sandboxID
string
)
{
func
(
m
*
kubeGenericRuntimeManager
)
podSandboxChanged
(
pod
*
v1
.
Pod
,
podStatus
*
kubecontainer
.
PodStatus
)
(
bool
,
uint32
,
string
)
{
if
len
(
podStatus
.
SandboxStatuses
)
==
0
{
glog
.
V
(
2
)
.
Infof
(
"No sandbox for pod %q can be found. Need to start a new one"
,
format
.
Pod
(
pod
))
return
true
,
0
,
""
...
...
@@ -803,7 +803,7 @@ func (m *kubeGenericRuntimeManager) isHostNetwork(podSandBoxID string, pod *v1.P
}
// GetPodStatus retrieves the status of the pod, including the
// information of all containers in the pod that are visble in Runtime.
// information of all containers in the pod that are vis
i
ble in Runtime.
func
(
m
*
kubeGenericRuntimeManager
)
GetPodStatus
(
uid
kubetypes
.
UID
,
name
,
namespace
string
)
(
*
kubecontainer
.
PodStatus
,
error
)
{
// Now we retain restart count of container as a container label. Each time a container
// restarts, pod will read the restart count from the registered dead container, increment
...
...
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