chore: remove code for 0.12 backwards compatibility in protocol support (#5622)

pull/5627/head
Irena Rindos 1 year ago committed by GitHub
parent f449ae5a70
commit 84c626a459
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -30,17 +30,10 @@ import (
"github.com/hashicorp/nodeenrollment"
"github.com/hashicorp/nodeenrollment/types"
"google.golang.org/protobuf/proto"
"google.golang.org/protobuf/types/known/anypb"
"google.golang.org/protobuf/types/known/timestamppb"
"nhooyr.io/websocket"
)
var GetProtocolContext = nilProtocolContext
func nilProtocolContext(context.Context, string, session.Session, string) (*anypb.Any, error) {
return nil, nil
}
type HandlerProperties struct {
ListenerConfig *listenerutil.ListenerConfig
}
@ -267,14 +260,6 @@ func (w *Worker) handleProxy(listenerCfg *listenerutil.ListenerConfig, sessionMa
return
}
protocolCtx := acResp.GetProtocolContext()
if protocolCtx == nil {
// TODO: Remove this if block once pre v0.12.0 controllers are no longer supported.
if protocolCtx, err = GetProtocolContext(ctx, workerId, sess, endpointUrl.Scheme); err != nil {
conn.Close(proxyHandlers.WebsocketStatusProtocolSetupError, "unable to get proxy context")
event.WriteError(ctx, op, err)
return
}
}
pDialer, err := proxyHandlers.GetEndpointDialer(ctx, endpointUrl.Host, workerId, acResp, w.downstreamReceiver, proxyHandlers.WithDnsServerAddress(w.conf.WorkerDnsServer))
if err != nil {

Loading…
Cancel
Save