-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Avoid keeping @docker_cli_[UUID] files #4862
Conversation
cli-plugins/socket/socket_openbsd.go
Outdated
|
||
func listen(socketname string) (*net.UnixListener, error) { | ||
return net.ListenUnix("unix", &net.UnixAddr{ | ||
Name: "@" + socketname, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Curious; was there a reason to differentiate from the Darwin implementation here? Looks like the difference here with the Darwin one is that that one uses the system's temp-dir as an extra precaution from these ending up in the working-directory (which could also be the build-context);
Name: filepath.Join(os.TempDir(), socketname),
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@thaJeztah good point. Mainly becuase it has naming darwin and nondarwin :)
But I like this way more, let me try it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It works like a charm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, that's great!
I'm not at my computer right now; are the openBSD and Darwin implementations now exactly the same?
If they are, perhaps we should use the same file for both then. I guess the file suffix should be renamed to something else the (_nolinux? _other?) good suggestions for that welcome 😅
cc @laurazard
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And better to rename nodarwin as well.
But I really have not idea regarding naming.
no Linux seems wrong because at least FreeBSD exists which behavior is unknown for me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for missing this one; the naming is pretty obvious IMO as FreeBSD also does not have abstract sockets (they are a Linux-ism); we just go with abstract
and noabstract
😄
Seems that OpenBSD behaves like darwin and requires to unlink all socket, after it was used. Tested on OpenBSD 7.4 Signed-off-by: Kirill A. Korinsky <kirill@korins.ky>
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #4862 +/- ##
==========================================
+ Coverage 61.29% 61.32% +0.02%
==========================================
Files 287 287
Lines 20041 20058 +17
==========================================
+ Hits 12285 12300 +15
- Misses 6865 6866 +1
- Partials 891 892 +1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch! LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Naming is hard, and I don't have a good suggestion for #4862 (comment)
It's just a couple of lines of duplicated code, and we can easily fix in future if we come up with a name. I guess the only risk is for them to diverge, but let's keep that for a follow up 😅
LGTM
Seems that OpenBSD behaves like darwin and requires to unlink all socket, after it was used.
Tested on OpenBSD 7.4