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
c1d1a010
Commit
c1d1a010
authored
Jun 12, 2015
by
Dawn Chen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add logging at RunInContainer for future debugging docker exec issues.
parent
bd6db7b1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
0 deletions
+5
-0
manager.go
pkg/kubelet/dockertools/manager.go
+5
-0
No files found.
pkg/kubelet/dockertools/manager.go
View file @
c1d1a010
...
@@ -910,8 +910,10 @@ func (dm *DockerManager) RunInContainer(containerID string, cmd []string) ([]byt
...
@@ -910,8 +910,10 @@ func (dm *DockerManager) RunInContainer(containerID string, cmd []string) ([]byt
return
nil
,
err
return
nil
,
err
}
}
if
!
useNativeExec
{
if
!
useNativeExec
{
glog
.
V
(
2
)
.
Infof
(
"Using nsinit to run the command %+v inside container %s"
,
cmd
,
containerID
)
return
dm
.
runInContainerUsingNsinit
(
containerID
,
cmd
)
return
dm
.
runInContainerUsingNsinit
(
containerID
,
cmd
)
}
}
glog
.
V
(
2
)
.
Infof
(
"Using docker native exec to run cmd %+v inside container %s"
,
cmd
,
containerID
)
createOpts
:=
docker
.
CreateExecOptions
{
createOpts
:=
docker
.
CreateExecOptions
{
Container
:
containerID
,
Container
:
containerID
,
Cmd
:
cmd
,
Cmd
:
cmd
,
...
@@ -934,16 +936,19 @@ func (dm *DockerManager) RunInContainer(containerID string, cmd []string) ([]byt
...
@@ -934,16 +936,19 @@ func (dm *DockerManager) RunInContainer(containerID string, cmd []string) ([]byt
}
}
err
=
dm
.
client
.
StartExec
(
execObj
.
ID
,
startOpts
)
err
=
dm
.
client
.
StartExec
(
execObj
.
ID
,
startOpts
)
if
err
!=
nil
{
if
err
!=
nil
{
glog
.
V
(
2
)
.
Infof
(
"StartExec With error: %v"
,
err
)
return
nil
,
err
return
nil
,
err
}
}
tick
:=
time
.
Tick
(
2
*
time
.
Second
)
tick
:=
time
.
Tick
(
2
*
time
.
Second
)
for
{
for
{
inspect
,
err2
:=
dm
.
client
.
InspectExec
(
execObj
.
ID
)
inspect
,
err2
:=
dm
.
client
.
InspectExec
(
execObj
.
ID
)
if
err2
!=
nil
{
if
err2
!=
nil
{
glog
.
V
(
2
)
.
Infof
(
"InspectExec %s failed with error: %+v"
,
execObj
.
ID
,
err2
)
return
buf
.
Bytes
(),
err2
return
buf
.
Bytes
(),
err2
}
}
if
!
inspect
.
Running
{
if
!
inspect
.
Running
{
if
inspect
.
ExitCode
!=
0
{
if
inspect
.
ExitCode
!=
0
{
glog
.
V
(
2
)
.
Infof
(
"InspectExec %s exit with result %+v"
,
execObj
.
ID
,
inspect
)
err
=
&
dockerExitError
{
inspect
}
err
=
&
dockerExitError
{
inspect
}
}
}
break
break
...
...
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