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
39858db2
Commit
39858db2
authored
Oct 29, 2015
by
jiangyaoguo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add new event when infra-container change
parent
3ce5a510
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
0 deletions
+10
-0
manager.go
pkg/kubelet/dockertools/manager.go
+10
-0
No files found.
pkg/kubelet/dockertools/manager.go
View file @
39858db2
...
@@ -1672,6 +1672,7 @@ func (dm *DockerManager) createPodInfraContainer(pod *api.Pod) (kubetypes.Docker
...
@@ -1672,6 +1672,7 @@ func (dm *DockerManager) createPodInfraContainer(pod *api.Pod) (kubetypes.Docker
type
empty
struct
{}
type
empty
struct
{}
type
PodContainerChangesSpec
struct
{
type
PodContainerChangesSpec
struct
{
StartInfraContainer
bool
StartInfraContainer
bool
InfraChanged
bool
InfraContainerId
kubetypes
.
DockerID
InfraContainerId
kubetypes
.
DockerID
ContainersToStart
map
[
int
]
empty
ContainersToStart
map
[
int
]
empty
ContainersToKeep
map
[
kubetypes
.
DockerID
]
int
ContainersToKeep
map
[
kubetypes
.
DockerID
]
int
...
@@ -1777,6 +1778,7 @@ func (dm *DockerManager) computePodContainerChanges(pod *api.Pod, runningPod kub
...
@@ -1777,6 +1778,7 @@ func (dm *DockerManager) computePodContainerChanges(pod *api.Pod, runningPod kub
return
PodContainerChangesSpec
{
return
PodContainerChangesSpec
{
StartInfraContainer
:
createPodInfraContainer
,
StartInfraContainer
:
createPodInfraContainer
,
InfraChanged
:
changed
,
InfraContainerId
:
podInfraContainerID
,
InfraContainerId
:
podInfraContainerID
,
ContainersToStart
:
containersToStart
,
ContainersToStart
:
containersToStart
,
ContainersToKeep
:
containersToKeep
,
ContainersToKeep
:
containersToKeep
,
...
@@ -1811,10 +1813,18 @@ func (dm *DockerManager) SyncPod(pod *api.Pod, runningPod kubecontainer.Pod, pod
...
@@ -1811,10 +1813,18 @@ func (dm *DockerManager) SyncPod(pod *api.Pod, runningPod kubecontainer.Pod, pod
}
}
glog
.
V
(
3
)
.
Infof
(
"Got container changes for pod %q: %+v"
,
podFullName
,
containerChanges
)
glog
.
V
(
3
)
.
Infof
(
"Got container changes for pod %q: %+v"
,
podFullName
,
containerChanges
)
if
containerChanges
.
InfraChanged
{
ref
,
err
:=
api
.
GetReference
(
pod
)
if
err
!=
nil
{
glog
.
Errorf
(
"Couldn't make a ref to pod %q: '%v'"
,
podFullName
,
err
)
}
dm
.
recorder
.
Eventf
(
ref
,
"InfraChanged"
,
"Pod infrastructure changed, it will be killed and re-created."
)
}
if
containerChanges
.
StartInfraContainer
||
(
len
(
containerChanges
.
ContainersToKeep
)
==
0
&&
len
(
containerChanges
.
ContainersToStart
)
==
0
)
{
if
containerChanges
.
StartInfraContainer
||
(
len
(
containerChanges
.
ContainersToKeep
)
==
0
&&
len
(
containerChanges
.
ContainersToStart
)
==
0
)
{
if
len
(
containerChanges
.
ContainersToKeep
)
==
0
&&
len
(
containerChanges
.
ContainersToStart
)
==
0
{
if
len
(
containerChanges
.
ContainersToKeep
)
==
0
&&
len
(
containerChanges
.
ContainersToStart
)
==
0
{
glog
.
V
(
4
)
.
Infof
(
"Killing Infra Container for %q because all other containers are dead."
,
podFullName
)
glog
.
V
(
4
)
.
Infof
(
"Killing Infra Container for %q because all other containers are dead."
,
podFullName
)
}
else
{
}
else
{
glog
.
V
(
4
)
.
Infof
(
"Killing Infra Container for %q, will start new one"
,
podFullName
)
glog
.
V
(
4
)
.
Infof
(
"Killing Infra Container for %q, will start new one"
,
podFullName
)
}
}
...
...
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