use dailcontext
Kubernetes-commit: 89f3fa3d62791e756dcbd645818ea03d7c1a86b8
This commit is contained in:
		
							parent
							
								
									67c8928411
								
							
						
					
					
						commit
						164f30a663
					
				|  | @ -59,7 +59,10 @@ func NewGRPCService(endpoint string) (Service, error) { | |||
| 		return nil, err | ||||
| 	} | ||||
| 
 | ||||
| 	connection, err := grpc.Dial(addr, grpc.WithInsecure(), grpc.WithTimeout(timeout), grpc.WithDialer(unixDial)) | ||||
| 	ctx, cancel := context.WithTimeout(context.Background(), timeout) | ||||
| 	defer cancel() | ||||
| 
 | ||||
| 	connection, err := grpc.DialContext(ctx, addr, grpc.WithInsecure(), grpc.WithDialer(unixDial)) | ||||
| 	if err != nil { | ||||
| 		return nil, fmt.Errorf("connect remote KMS provider %q failed, error: %v", addr, err) | ||||
| 	} | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue