// PortForward prepares a streaming endpoint to forward ports from a PodSandbox.
PortForward prepares a streaming endpoint to forward ports from a PodSandbox.
// PortForward prepares a streaming endpoint to forward ports from a PodSandbox .
func (h *Runtime) PortForward(req *kubeapi.PortForwardRequest) (*kubeapi.PortForwardResponse, error) {
	if h.streamingServer == nil {
		return nil, streaming.ErrorStreamingDisabled("portforward")
	}
	running, err := isPodSandboxRunning(h.client, req.PodSandboxId)
	if err != nil {
		glog.Errorf("isPodSandboxRunning for sandbox %q: %v", req.PodSandboxId, err)
		return nil, err
	}
	if !running {
		return nil, fmt.Errorf("sandbox %s is not running", req.PodSandboxId)
	}
	return h.streamingServer.GetPortForward(req)
}
func ( h * Runtime ) PortForward ( req * kubeapi . PortForwardRequest ) ( * kubeapi . PortForwardResponse , error ) { if h . streamingServer == nil { return nil , streaming . ErrorStreamingDisabled ( " " ) } running , err := isPodSandboxRunning ( h . client , req . PodSandboxId ) if err != nil { glog . Errorf ( " " , req . PodSandboxId , err ) return nil , err } if ! running { return nil , fmt . Errorf ( " " , req . PodSandboxId ) } return h . streamingServer . GetPortForward ( req ) }
PortForward prepares a streaming endpoint to forward ports from a PodSandbox.
PortForward prepares a streaming endpoint to forward ports from a PodSandbox .