Skip to content

add support for unix domain sockets#680

Open
flokli wants to merge 1 commit intoktr0731:masterfrom
flokli:unix-domain-sockets
Open

add support for unix domain sockets#680
flokli wants to merge 1 commit intoktr0731:masterfrom
flokli:unix-domain-sockets

Conversation

@flokli
Copy link
Contributor

@flokli flokli commented Oct 8, 2023

grpc.NewClient already supports connecting to unix domain sockets, and accepts a string anyways.

As a quick fix, detect the address starting with unix:// and don't add the port.

In the long term, we might want to deprecate host and port cmdline args in favor of a single address arg.

Fixes #654.

grpc.NewClient already supports connecting to unix domain sockets, and
accepts a string anyways.

As a quick fix, detect the `address` starting with `unix://` and don't
add the port.

In the long term, we might want to deprecate `host` and `port` cmdline
args in favor of a single `address` arg.
@codecov
Copy link

codecov bot commented Oct 8, 2023

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 77.13%. Comparing base (d1bc03a) to head (55d7e7a).
⚠️ Report is 1 commits behind head on master.

❌ Your project check has failed because the head coverage (77.13%) is below the target coverage (80.00%). You can increase the head coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #680      +/-   ##
==========================================
+ Coverage   77.10%   77.13%   +0.02%     
==========================================
  Files          57       57              
  Lines        3910     3915       +5     
==========================================
+ Hits         3015     3020       +5     
  Misses        647      647              
  Partials      248      248              
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@flokli
Copy link
Contributor Author

flokli commented Nov 6, 2023

@ktr0731 poke ;-)

addr := cfg.Server.Host

// as long as the address doesn't start with unix, also add the port.
if !strings.HasPrefix(cfg.Server.Host, "unix://") {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would personally add --unix switch and use that to decide if we do host:port or just host

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm waiting on @ktr0731 to decide on the path forward.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Poke @ktr0731 @kakke18. Any opinion on this, or reservations against this PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature request: add support for unix domain socket

2 participants