mirror of
https://github.com/kubernetes/client-go.git
synced 2025-09-13 05:41:35 +00:00
published by bot
(https://github.com/kubernetes/test-infra/tree/master/mungegithub) copied from https://github.com/kubernetes/kubernetes.git, branch master, last commit is c09311fa32be02ebb79c7959447e3e4294cc12a3
This commit is contained in:
@@ -27,12 +27,15 @@ import (
|
||||
"strings"
|
||||
"sync"
|
||||
|
||||
"k8s.io/apimachinery/pkg/util/httpstream"
|
||||
"k8s.io/apimachinery/pkg/util/runtime"
|
||||
"k8s.io/client-go/pkg/api"
|
||||
"k8s.io/client-go/pkg/kubelet/server/portforward"
|
||||
"k8s.io/client-go/pkg/util/httpstream"
|
||||
)
|
||||
|
||||
// TODO move to API machinery and re-unify with kubelet/server/portfoward
|
||||
// The subprotocol "portforward.k8s.io" is used for port forwarding.
|
||||
const PortForwardProtocolV1Name = "portforward.k8s.io"
|
||||
|
||||
// PortForwarder knows how to listen for local connections and forward them to
|
||||
// a remote pod via an upgraded HTTP request.
|
||||
type PortForwarder struct {
|
||||
@@ -132,7 +135,7 @@ func (pf *PortForwarder) ForwardPorts() error {
|
||||
defer pf.Close()
|
||||
|
||||
var err error
|
||||
pf.streamConn, _, err = pf.dialer.Dial(portforward.PortForwardProtocolV1Name)
|
||||
pf.streamConn, _, err = pf.dialer.Dial(PortForwardProtocolV1Name)
|
||||
if err != nil {
|
||||
return fmt.Errorf("error upgrading connection: %s", err)
|
||||
}
|
||||
|
Reference in New Issue
Block a user