mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-13 10:33:35 +00:00
rebase: update kubernetes and libraries to v1.22.0 version
Kubernetes v1.22 version has been released and this update ceph csi dependencies to use the same version. Signed-off-by: Humble Chirammal <hchiramm@redhat.com>
This commit is contained in:
committed by
mergify[bot]
parent
e077c1fdf5
commit
aa698bc3e1
14
vendor/sigs.k8s.io/apiserver-network-proxy/konnectivity-client/pkg/client/client.go
generated
vendored
14
vendor/sigs.k8s.io/apiserver-network-proxy/konnectivity-client/pkg/client/client.go
generated
vendored
@ -35,7 +35,7 @@ import (
|
||||
type Tunnel interface {
|
||||
// Dial connects to the address on the named network, similar to
|
||||
// what net.Dial does. The only supported protocol is tcp.
|
||||
Dial(protocol, address string) (net.Conn, error)
|
||||
DialContext(ctx context.Context, protocol, address string) (net.Conn, error)
|
||||
}
|
||||
|
||||
type dialResult struct {
|
||||
@ -66,15 +66,15 @@ var _ clientConn = &grpc.ClientConn{}
|
||||
// gRPC based proxy service.
|
||||
// Currently, a single tunnel supports a single connection, and the tunnel is closed when the connection is terminated
|
||||
// The Dial() method of the returned tunnel should only be called once
|
||||
func CreateSingleUseGrpcTunnel(address string, opts ...grpc.DialOption) (Tunnel, error) {
|
||||
c, err := grpc.Dial(address, opts...)
|
||||
func CreateSingleUseGrpcTunnel(ctx context.Context, address string, opts ...grpc.DialOption) (Tunnel, error) {
|
||||
c, err := grpc.DialContext(ctx, address, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
grpcClient := client.NewProxyServiceClient(c)
|
||||
|
||||
stream, err := grpcClient.Proxy(context.Background())
|
||||
stream, err := grpcClient.Proxy(ctx)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@ -175,7 +175,7 @@ func (t *grpcTunnel) serve(c clientConn) {
|
||||
|
||||
// Dial connects to the address on the named network, similar to
|
||||
// what net.Dial does. The only supported protocol is tcp.
|
||||
func (t *grpcTunnel) Dial(protocol, address string) (net.Conn, error) {
|
||||
func (t *grpcTunnel) DialContext(ctx context.Context, protocol, address string) (net.Conn, error) {
|
||||
if protocol != "tcp" {
|
||||
return nil, errors.New("protocol not supported")
|
||||
}
|
||||
@ -224,7 +224,9 @@ func (t *grpcTunnel) Dial(protocol, address string) (net.Conn, error) {
|
||||
t.conns[res.connid] = c
|
||||
t.connsLock.Unlock()
|
||||
case <-time.After(30 * time.Second):
|
||||
return nil, errors.New("dial timeout")
|
||||
return nil, errors.New("dial timeout, backstop")
|
||||
case <-ctx.Done():
|
||||
return nil, errors.New("dial timeout, context")
|
||||
}
|
||||
|
||||
return c, nil
|
||||
|
Reference in New Issue
Block a user