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
3d24d25f
Commit
3d24d25f
authored
Dec 11, 2015
by
k8s-merge-robot
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #17764 from jiangyaoguo/make-containerspecchange-private
Auto commit by PR queue bot
parents
5ff88a4e
5f77f2b5
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
5 deletions
+4
-5
manager.go
pkg/kubelet/dockertools/manager.go
+4
-5
No files found.
pkg/kubelet/dockertools/manager.go
View file @
3d24d25f
...
@@ -1608,7 +1608,6 @@ func (dm *DockerManager) createPodInfraContainer(pod *api.Pod) (kubetypes.Docker
...
@@ -1608,7 +1608,6 @@ func (dm *DockerManager) createPodInfraContainer(pod *api.Pod) (kubetypes.Docker
return
kubetypes
.
DockerID
(
id
.
ID
),
nil
return
kubetypes
.
DockerID
(
id
.
ID
),
nil
}
}
// TODO(vmarmol): This will soon be made non-public when its only use is internal.
// Structure keeping information on changes that need to happen for a pod. The semantics is as follows:
// Structure keeping information on changes that need to happen for a pod. The semantics is as follows:
// - startInfraContainer is true if new Infra Containers have to be started and old one (if running) killed.
// - startInfraContainer is true if new Infra Containers have to be started and old one (if running) killed.
// Additionally if it is true then containersToKeep have to be empty
// Additionally if it is true then containersToKeep have to be empty
...
@@ -1619,7 +1618,7 @@ func (dm *DockerManager) createPodInfraContainer(pod *api.Pod) (kubetypes.Docker
...
@@ -1619,7 +1618,7 @@ func (dm *DockerManager) createPodInfraContainer(pod *api.Pod) (kubetypes.Docker
// It shouldn't be the case where containersToStart is empty and containersToKeep contains only infraContainerId. In such case
// It shouldn't be the case where containersToStart is empty and containersToKeep contains only infraContainerId. In such case
// Infra Container should be killed, hence it's removed from this map.
// Infra Container should be killed, hence it's removed from this map.
// - all running containers which are NOT contained in containersToKeep should be killed.
// - all running containers which are NOT contained in containersToKeep should be killed.
type
P
odContainerChangesSpec
struct
{
type
p
odContainerChangesSpec
struct
{
StartInfraContainer
bool
StartInfraContainer
bool
InfraChanged
bool
InfraChanged
bool
InfraContainerId
kubetypes
.
DockerID
InfraContainerId
kubetypes
.
DockerID
...
@@ -1627,7 +1626,7 @@ type PodContainerChangesSpec struct {
...
@@ -1627,7 +1626,7 @@ type PodContainerChangesSpec struct {
ContainersToKeep
map
[
kubetypes
.
DockerID
]
int
ContainersToKeep
map
[
kubetypes
.
DockerID
]
int
}
}
func
(
dm
*
DockerManager
)
computePodContainerChanges
(
pod
*
api
.
Pod
,
podStatus
*
kubecontainer
.
PodStatus
)
(
P
odContainerChangesSpec
,
error
)
{
func
(
dm
*
DockerManager
)
computePodContainerChanges
(
pod
*
api
.
Pod
,
podStatus
*
kubecontainer
.
PodStatus
)
(
p
odContainerChangesSpec
,
error
)
{
start
:=
time
.
Now
()
start
:=
time
.
Now
()
defer
func
()
{
defer
func
()
{
metrics
.
ContainerManagerLatency
.
WithLabelValues
(
"computePodContainerChanges"
)
.
Observe
(
metrics
.
SinceInMicroseconds
(
start
))
metrics
.
ContainerManagerLatency
.
WithLabelValues
(
"computePodContainerChanges"
)
.
Observe
(
metrics
.
SinceInMicroseconds
(
start
))
...
@@ -1645,7 +1644,7 @@ func (dm *DockerManager) computePodContainerChanges(pod *api.Pod, podStatus *kub
...
@@ -1645,7 +1644,7 @@ func (dm *DockerManager) computePodContainerChanges(pod *api.Pod, podStatus *kub
glog
.
V
(
4
)
.
Infof
(
"Found pod infra container for %q"
,
format
.
Pod
(
pod
))
glog
.
V
(
4
)
.
Infof
(
"Found pod infra container for %q"
,
format
.
Pod
(
pod
))
changed
,
err
=
dm
.
podInfraContainerChanged
(
pod
,
podInfraContainerStatus
)
changed
,
err
=
dm
.
podInfraContainerChanged
(
pod
,
podInfraContainerStatus
)
if
err
!=
nil
{
if
err
!=
nil
{
return
P
odContainerChangesSpec
{},
err
return
p
odContainerChangesSpec
{},
err
}
}
}
}
...
@@ -1726,7 +1725,7 @@ func (dm *DockerManager) computePodContainerChanges(pod *api.Pod, podStatus *kub
...
@@ -1726,7 +1725,7 @@ func (dm *DockerManager) computePodContainerChanges(pod *api.Pod, podStatus *kub
containersToKeep
=
make
(
map
[
kubetypes
.
DockerID
]
int
)
containersToKeep
=
make
(
map
[
kubetypes
.
DockerID
]
int
)
}
}
return
P
odContainerChangesSpec
{
return
p
odContainerChangesSpec
{
StartInfraContainer
:
createPodInfraContainer
,
StartInfraContainer
:
createPodInfraContainer
,
InfraChanged
:
changed
,
InfraChanged
:
changed
,
InfraContainerId
:
podInfraContainerID
,
InfraContainerId
:
podInfraContainerID
,
...
...
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