aboutsummaryrefslogtreecommitdiff
path: root/vendor/k8s.io/apimachinery/pkg/util/httpstream/httpstream.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/k8s.io/apimachinery/pkg/util/httpstream/httpstream.go')
-rw-r--r--vendor/k8s.io/apimachinery/pkg/util/httpstream/httpstream.go8
1 files changed, 2 insertions, 6 deletions
diff --git a/vendor/k8s.io/apimachinery/pkg/util/httpstream/httpstream.go b/vendor/k8s.io/apimachinery/pkg/util/httpstream/httpstream.go
index 50d9a366f..9d5fdeece 100644
--- a/vendor/k8s.io/apimachinery/pkg/util/httpstream/httpstream.go
+++ b/vendor/k8s.io/apimachinery/pkg/util/httpstream/httpstream.go
@@ -123,15 +123,11 @@ func negotiateProtocol(clientProtocols, serverProtocols []string) string {
func Handshake(req *http.Request, w http.ResponseWriter, serverProtocols []string) (string, error) {
clientProtocols := req.Header[http.CanonicalHeaderKey(HeaderProtocolVersion)]
if len(clientProtocols) == 0 {
- // Kube 1.0 clients didn't support subprotocol negotiation.
- // TODO require clientProtocols once Kube 1.0 is no longer supported
- return "", nil
+ return "", fmt.Errorf("unable to upgrade: %s is required", HeaderProtocolVersion)
}
if len(serverProtocols) == 0 {
- // Kube 1.0 servers didn't support subprotocol negotiation. This is mainly for testing.
- // TODO require serverProtocols once Kube 1.0 is no longer supported
- return "", nil
+ panic(fmt.Errorf("unable to upgrade: serverProtocols is required"))
}
negotiatedProtocol := negotiateProtocol(clientProtocols, serverProtocols)