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
5b8b7d1a
Commit
5b8b7d1a
authored
Jan 28, 2016
by
Fabio Yeon
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #20284 from ncdc/flake/20268
Help debug port forward flakes
parents
430acc73
86ae623a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
1 deletion
+11
-1
manager.go
pkg/kubelet/dockertools/manager.go
+11
-1
No files found.
pkg/kubelet/dockertools/manager.go
View file @
5b8b7d1a
...
@@ -1215,9 +1215,15 @@ func (dm *DockerManager) PortForward(pod *kubecontainer.Pod, port uint16, stream
...
@@ -1215,9 +1215,15 @@ func (dm *DockerManager) PortForward(pod *kubecontainer.Pod, port uint16, stream
return
fmt
.
Errorf
(
"unable to do port forwarding: nsenter not found."
)
return
fmt
.
Errorf
(
"unable to do port forwarding: nsenter not found."
)
}
}
commandString
:=
fmt
.
Sprintf
(
"%s %s"
,
nsenterPath
,
strings
.
Join
(
args
,
" "
))
glog
.
V
(
4
)
.
Infof
(
"executing port forwarding command: %s"
,
commandString
)
command
:=
exec
.
Command
(
nsenterPath
,
args
...
)
command
:=
exec
.
Command
(
nsenterPath
,
args
...
)
command
.
Stdout
=
stream
command
.
Stdout
=
stream
stderr
:=
new
(
bytes
.
Buffer
)
command
.
Stderr
=
stderr
// If we use Stdin, command.Run() won't return until the goroutine that's copying
// If we use Stdin, command.Run() won't return until the goroutine that's copying
// from stream finishes. Unfortunately, if you have a client like telnet connected
// from stream finishes. Unfortunately, if you have a client like telnet connected
// via port forwarding, as long as the user's telnet client is connected to the user's
// via port forwarding, as long as the user's telnet client is connected to the user's
...
@@ -1236,7 +1242,11 @@ func (dm *DockerManager) PortForward(pod *kubecontainer.Pod, port uint16, stream
...
@@ -1236,7 +1242,11 @@ func (dm *DockerManager) PortForward(pod *kubecontainer.Pod, port uint16, stream
inPipe
.
Close
()
inPipe
.
Close
()
}()
}()
return
command
.
Run
()
if
err
:=
command
.
Run
();
err
!=
nil
{
return
fmt
.
Errorf
(
"%v: %s"
,
err
,
stderr
.
String
())
}
return
nil
}
}
// Get the IP address of a container's interface using nsenter
// Get the IP address of a container's interface using nsenter
...
...
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