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.
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.
@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.
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.
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.
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 |
thaJeztah
left a comment
There was a problem hiding this comment.
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