Skip to content

refactor(api): use abstract Unix socket for daemon on Linux#564

Merged
joe0BAB merged 1 commit into
mainfrom
feat/abstract-socket
Jun 25, 2026
Merged

refactor(api): use abstract Unix socket for daemon on Linux#564
joe0BAB merged 1 commit into
mainfrom
feat/abstract-socket

Conversation

@joe0BAB

@joe0BAB joe0BAB commented Jun 25, 2026

Copy link
Copy Markdown
Collaborator

Split the non-Windows DaemonSocketPath into a darwin-only filesystem path and a Linux implementation that returns an abstract Unix domain socket address (leading "@", which Go maps to a NUL byte). Abstract sockets live in the abstract namespace rather than on the filesystem, so there are no stale socket files, no directory permission concerns, and the socket is reclaimed automatically when the daemon exits. The address is namespaced by UID to avoid collisions between users.

The plugin config test skips filesystem setup for abstract addresses.

Split the non-Windows DaemonSocketPath into a darwin-only filesystem
path and a Linux implementation that returns an abstract Unix domain
socket address (leading "@", which Go maps to a NUL byte). Abstract
sockets live in the abstract namespace rather than on the filesystem,
so there are no stale socket files, no directory permission concerns,
and the socket is reclaimed automatically when the daemon exits. The
address is namespaced by UID to avoid collisions between users.

The plugin config test skips filesystem setup for abstract addresses.
@joe0BAB joe0BAB marked this pull request as ready for review June 25, 2026 12:51

@docker-agent docker-agent left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Assessment: 🟢 APPROVE

The abstract Unix domain socket refactor is well-implemented. The @-prefix convention is correct for Go's abstract socket namespace, UID namespacing is sound, and the plugin config test properly skips filesystem setup for abstract addresses.

One minor note logged as an inline comment.

Comment thread x/api/defaults_darwin.go
// limitations under the License.

//go:build !windows
//go:build darwin

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[LOW] Platform coverage gap: non-darwin/non-linux Unix platforms have no DaemonSocketPath() implementation

The original defaults_unix.go used //go:build !windows, which implicitly covered FreeBSD, OpenBSD, illumos, and any other non-Windows platform. This PR replaces it with two explicitly-tagged files (darwin and linux), leaving every other Unix-like OS without an implementation of DaemonSocketPath() — the package would fail to compile on those platforms.

In practice, docker/secrets-engine targets Linux and macOS (darwin), so this is theoretical rather than immediately harmful. However, the narrowing of platform coverage introduces a latent regression relative to the prior code with no documented rationale for the exclusion.

If intentional, consider adding a comment to defaults_darwin.go (or a new defaults_unix_other.go with //go:build !linux && !windows && !darwin) explaining the scope decision, so future contributors understand why FreeBSD etc. are not supported.

@joe0BAB joe0BAB merged commit f1ab3a7 into main Jun 25, 2026
24 checks passed
@joe0BAB joe0BAB deleted the feat/abstract-socket branch June 25, 2026 12:56
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.

3 participants