mirror of
https://github.com/netbirdio/netbird.git
synced 2026-08-26 09:31:30 +02:00
[client] Skip the sweeper dial option without a netevents manager
Review feedback on #7254: restore the nil guard around WithSweeper in the signal and management clients. The nil *Manager is safe through the whole dial chain, but passing it into the Sweeper interface hides that behind a typed nil, and on desktop, where the manager is always nil, the extra context dialer overrode WithCustomDialer just to be a no-op.
This commit is contained in:
@@ -142,7 +142,9 @@ func NewClient(ctx context.Context, addr string, ourPrivateKey wgtypes.Key, tlsE
|
||||
extraOpts = append(extraOpts, grpc.WithDefaultCallOptions(grpc.MaxCallRecvMsgSize(maxSize)))
|
||||
log.Infof("management gRPC max receive message size set to %d bytes", maxSize)
|
||||
}
|
||||
extraOpts = append(extraOpts, nbgrpc.WithSweeper(c.netMgr))
|
||||
if c.netMgr != nil {
|
||||
extraOpts = append(extraOpts, nbgrpc.WithSweeper(c.netMgr))
|
||||
}
|
||||
|
||||
var conn *grpc.ClientConn
|
||||
operation := func() error {
|
||||
|
||||
@@ -116,7 +116,9 @@ func NewClient(ctx context.Context, addr string, key wgtypes.Key, tlsEnabled boo
|
||||
}
|
||||
|
||||
var extraOpts []grpc.DialOption
|
||||
extraOpts = append(extraOpts, nbgrpc.WithSweeper(c.netMgr))
|
||||
if c.netMgr != nil {
|
||||
extraOpts = append(extraOpts, nbgrpc.WithSweeper(c.netMgr))
|
||||
}
|
||||
|
||||
var conn *grpc.ClientConn
|
||||
operation := func() error {
|
||||
|
||||
Reference in New Issue
Block a user