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
1018d32d
Commit
1018d32d
authored
Nov 12, 2015
by
Lantao Liu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Deprecate old containers without TerminationMessagePath label
parent
54e6db08
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
10 deletions
+3
-10
manager.go
pkg/kubelet/dockertools/manager.go
+3
-10
No files found.
pkg/kubelet/dockertools/manager.go
View file @
1018d32d
...
@@ -338,8 +338,7 @@ func (dm *DockerManager) determineContainerIP(podNamespace, podName string, cont
...
@@ -338,8 +338,7 @@ func (dm *DockerManager) determineContainerIP(podNamespace, podName string, cont
return
result
return
result
}
}
// TODO (random-liu) Remove parameter tPath when old containers are deprecated.
func
(
dm
*
DockerManager
)
inspectContainer
(
dockerID
,
containerName
string
,
pod
*
api
.
Pod
)
*
containerStatusResult
{
func
(
dm
*
DockerManager
)
inspectContainer
(
dockerID
,
containerName
,
tPath
string
,
pod
*
api
.
Pod
)
*
containerStatusResult
{
result
:=
containerStatusResult
{
api
.
ContainerStatus
{},
""
,
nil
}
result
:=
containerStatusResult
{
api
.
ContainerStatus
{},
""
,
nil
}
inspectResult
,
err
:=
dm
.
client
.
InspectContainer
(
dockerID
)
inspectResult
,
err
:=
dm
.
client
.
InspectContainer
(
dockerID
)
...
@@ -410,11 +409,6 @@ func (dm *DockerManager) inspectContainer(dockerID, containerName, tPath string,
...
@@ -410,11 +409,6 @@ func (dm *DockerManager) inspectContainer(dockerID, containerName, tPath string,
ContainerID
:
DockerPrefix
+
dockerID
,
ContainerID
:
DockerPrefix
+
dockerID
,
}
}
terminationMessagePath
:=
getTerminationMessagePathFromLabel
(
inspectResult
.
Config
.
Labels
)
terminationMessagePath
:=
getTerminationMessagePathFromLabel
(
inspectResult
.
Config
.
Labels
)
if
terminationMessagePath
==
""
{
// Because old containers have no terminationMessagePath Label, we stil have to rely on the information from apiserver here.
// TODO (random-liu) Remove this later when old containers with no labels are deprecated.
terminationMessagePath
=
tPath
}
if
terminationMessagePath
!=
""
{
if
terminationMessagePath
!=
""
{
path
,
found
:=
inspectResult
.
Volumes
[
terminationMessagePath
]
path
,
found
:=
inspectResult
.
Volumes
[
terminationMessagePath
]
if
found
{
if
found
{
...
@@ -484,17 +478,16 @@ func (dm *DockerManager) GetPodStatus(pod *api.Pod) (*api.PodStatus, error) {
...
@@ -484,17 +478,16 @@ func (dm *DockerManager) GetPodStatus(pod *api.Pod) (*api.PodStatus, error) {
continue
continue
}
}
dockerContainerName
:=
dockerName
.
ContainerName
dockerContainerName
:=
dockerName
.
ContainerName
c
,
found
:=
expectedContainers
[
dockerContainerName
]
_
,
found
:=
expectedContainers
[
dockerContainerName
]
if
!
found
{
if
!
found
{
continue
continue
}
}
terminationMessagePath
:=
c
.
TerminationMessagePath
if
containerDone
.
Has
(
dockerContainerName
)
{
if
containerDone
.
Has
(
dockerContainerName
)
{
continue
continue
}
}
// Inspect the container.
// Inspect the container.
result
:=
dm
.
inspectContainer
(
value
.
ID
,
dockerContainerName
,
terminationMessagePath
,
pod
)
result
:=
dm
.
inspectContainer
(
value
.
ID
,
dockerContainerName
,
pod
)
if
result
.
err
!=
nil
{
if
result
.
err
!=
nil
{
return
nil
,
result
.
err
return
nil
,
result
.
err
}
}
...
...
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