Skip to content

Commit

Permalink
add net.Dialer with dialTimeout for nsmgr
Browse files Browse the repository at this point in the history
Signed-off-by: Denis Tingaikin <denis.tingajkin@xored.com>
  • Loading branch information
denis-tingaikin committed Oct 31, 2021
1 parent 5a3e43b commit d1ea21a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions internal/manager/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,10 @@ func RunNsmgr(ctx context.Context, configuration *config.Config) error {
credentials.NewTLS(tlsconfig.MTLSClientConfig(m.source, m.source, tlsconfig.AuthorizeAny())),
),
),
grpc.WithDialer(func(s string, _ time.Duration) (net.Conn, error) {
network, addr := grpcutils.TargetToNetAddr(s)
return (&net.Dialer{Timeout: configuration.DialTimeout}).DialContext(ctx, network, addr)
})
grpc.WithDefaultCallOptions(
grpc.PerRPCCredentials(token.NewPerRPCCredentials(spiffejwt.TokenGeneratorFunc(m.source, configuration.MaxTokenLifetime))),
),
Expand Down

0 comments on commit d1ea21a

Please sign in to comment.