diff --git a/pkg/rpc/health/client/client.go b/pkg/rpc/health/client/client.go index 7434701f37a..b3f8f7aa726 100644 --- a/pkg/rpc/health/client/client.go +++ b/pkg/rpc/health/client/client.go @@ -77,7 +77,7 @@ func Check(ctx context.Context, target string, opts ...grpc.DialOption) error { } defer healthClient.Close() - if err := healthClient.Check(context.Background(), &healthpb.HealthCheckRequest{}); err != nil { + if err := healthClient.Check(ctx, &healthpb.HealthCheckRequest{}); err != nil { return err } @@ -115,3 +115,8 @@ func (c *client) Check(ctx context.Context, req *healthpb.HealthCheckRequest, op return nil } + +// Close tears down the ClientConn and all underlying connections. +func (c *client) Close() error { + return c.ClientConn.Close() +}