// PortForward forward ports from a PodSandbox.
PortForward forward ports from a PodSandbox.
// PortForward forward ports from a PodSandbox .
func (sr *streamingRuntime) PortForward(podSandboxID string, port int32, stream io.ReadWriteCloser) error {
	running, err := isPodSandboxRunning(sr.client, podSandboxID)
	if err != nil {
		glog.Errorf("isPodSandboxRunning for sandbox %q: %v", podSandboxID, err)
		return err
	}
	if !running {
		return fmt.Errorf("sandbox %s is not running", podSandboxID)
	}
	cmds := []string{"/sbin/socat", "-", fmt.Sprintf("TCP4:127.0.0.1:%d", port)}
	return sr.client.ExecInSandbox(podSandboxID, cmds, stream, stream, stream, false, 0)
}
func ( sr * streamingRuntime ) PortForward ( podSandboxID string , port int32 , stream io . ReadWriteCloser ) error { running , err := isPodSandboxRunning ( sr . client , podSandboxID ) if err != nil { glog . Errorf ( " " , podSandboxID , err ) return err } if ! running { return fmt . Errorf ( " " , podSandboxID ) } cmds := [ ] string { " " , " " , fmt . Sprintf ( " " , port ) } return sr . client . ExecInSandbox ( podSandboxID , cmds , stream , stream , stream , false , 0 ) }
PortForward forward ports from a PodSandbox.
PortForward forward ports from a PodSandbox .