File tree Expand file tree Collapse file tree 1 file changed +13
-9
lines changed
Expand file tree Collapse file tree 1 file changed +13
-9
lines changed Original file line number Diff line number Diff line change @@ -2221,22 +2221,26 @@ func keyservices(c *cli.Context) (svcs []keyservice.KeyServiceClient) {
22212221 continue
22222222 }
22232223 addr := url .Host
2224- if url .Scheme == "unix" {
2225- addr = url .Path
2226- }
2224+ addrToUse := addr
22272225 opts := []grpc.DialOption {
22282226 grpc .WithTransportCredentials (insecure .NewCredentials ()),
2229- grpc .WithContextDialer (
2230- func (ctx context.Context , addr string ) (net.Conn , error ) {
2231- return (& net.Dialer {}).DialContext (ctx , url .Scheme , addr )
2232- },
2233- ),
2227+ }
2228+ if url .Scheme == "unix" {
2229+ addr = url .Path
2230+ addrToUse = uri
2231+ } else {
2232+ opts = append (opts ,
2233+ grpc .WithContextDialer (
2234+ func (ctx context.Context , addr string ) (net.Conn , error ) {
2235+ return (& net.Dialer {}).DialContext (ctx , url .Scheme , addr )
2236+ },
2237+ ))
22342238 }
22352239 log .WithField (
22362240 "address" ,
22372241 fmt .Sprintf ("%s://%s" , url .Scheme , addr ),
22382242 ).Infof ("Connecting to key service" )
2239- conn , err := grpc .NewClient (addr , opts ... )
2243+ conn , err := grpc .NewClient (addrToUse , opts ... )
22402244 if err != nil {
22412245 log .Fatalf ("failed to listen: %v" , err )
22422246 }
You can’t perform that action at this time.
0 commit comments