From 0fe84ff7cb1671d51769ad8f2378f919546a5f3a Mon Sep 17 00:00:00 2001 From: Sean Sullivan Date: Tue, 23 May 2023 16:15:07 -0700 Subject: [PATCH] Re-add the legacy wsstream package and deprecate it --- .../apiserver/pkg/util/wsstream/legacy.go | 59 +++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 staging/src/k8s.io/apiserver/pkg/util/wsstream/legacy.go diff --git a/staging/src/k8s.io/apiserver/pkg/util/wsstream/legacy.go b/staging/src/k8s.io/apiserver/pkg/util/wsstream/legacy.go new file mode 100644 index 00000000000..61b4dd48927 --- /dev/null +++ b/staging/src/k8s.io/apiserver/pkg/util/wsstream/legacy.go @@ -0,0 +1,59 @@ +/* +Copyright 2023 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Deprecated: This WebSockets package under apiserver is no longer in use. +// Please use the apimachinery version of the package at: +// +// k8s.io/apimachinery/pkg/util/httpstream/wsstream +package wsstream + +import apimachinerywsstream "k8s.io/apimachinery/pkg/util/httpstream/wsstream" + +// Aliases for all exported symbols previously in "conn.go" +const ( + ChannelWebSocketProtocol = apimachinerywsstream.ChannelWebSocketProtocol + Base64ChannelWebSocketProtocol = apimachinerywsstream.Base64ChannelWebSocketProtocol +) + +type ChannelType = apimachinerywsstream.ChannelType + +const ( + IgnoreChannel = apimachinerywsstream.IgnoreChannel + ReadChannel = apimachinerywsstream.ReadChannel + WriteChannel = apimachinerywsstream.WriteChannel + ReadWriteChannel = apimachinerywsstream.ReadWriteChannel +) + +type ChannelProtocolConfig = apimachinerywsstream.ChannelProtocolConfig + +var ( + IsWebSocketRequest = apimachinerywsstream.IsWebSocketRequest + IgnoreReceives = apimachinerywsstream.IgnoreReceives + NewDefaultChannelProtocols = apimachinerywsstream.NewDefaultChannelProtocols +) + +type Conn = apimachinerywsstream.Conn + +var NewConn = apimachinerywsstream.NewConn + +// Aliases for all exported symbols previously in "stream.go" +type ReaderProtocolConfig = apimachinerywsstream.ReaderProtocolConfig + +var NewDefaultReaderProtocols = apimachinerywsstream.NewDefaultReaderProtocols + +type Reader = apimachinerywsstream.Reader + +var NewReader = apimachinerywsstream.NewReader