code: func (s *Server) getPortForward(request *restful.Request, response *restful.Response) {
  	params := getPortForwardRequestParams(request)
  
  	portForwardOptions, err := portforward.NewV4Options(request.Request)
  	if err != nil {
  		utilruntime.HandleError(err)
  		response.WriteError(http.StatusBadRequest, err)
  		return
  	}
  	pod, ok := s.host.GetPodByName(params.podNamespace, params.podName)
  	if !ok {
  		response.WriteError(http.StatusNotFound, fmt.Errorf("pod does not exist"))
  		return
  	}
  	if len(params.podUID) > 0 && pod.UID != params.podUID {
  		response.WriteError(http.StatusNotFound, fmt.Errorf("pod not found"))
  		return
  	}
  
  	url, err := s.host.GetPortForward(pod.Name, pod.Namespace, pod.UID, *portForwardOptions)
  	if err != nil {
  		streaming.WriteError(err, response.ResponseWriter)
  		return
  	}
  	if s.redirectContainerStreaming {
  		http.Redirect(response.ResponseWriter, request.Request, url.String(), http.StatusFound)
  		return
  	}
  	proxyStream(response.ResponseWriter, request.Request, url)
  }
docs: // getPortForward handles a new restful port forward request. It determines the
  // pod name and uid and then calls ServePortForward.