-
Notifications
You must be signed in to change notification settings - Fork 1.2k
fix: finch linux rootless containerd detection #8650
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
base: develop
Are you sure you want to change the base?
Changes from 2 commits
2a8375b
f8d0c45
58660b5
d75e765
f50eb00
a5e143d
dfc9132
a4e2969
c24b7f9
123ef89
02b392b
b2a46eb
39df6d3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -123,11 +123,49 @@ def _read_config(self) -> Optional[str]: | |
|
|
||
| def get_finch_socket_path(self) -> Optional[str]: | ||
| """ | ||
| Returns the socket path for Linux. | ||
| """ | ||
|
|
||
| # Default fallback to system socket | ||
| return "unix:///var/run/finch.sock" | ||
| Returns the socket path for Linux, checking multiple locations. | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. needs integ test to check builds work too in rootless mode? |
||
|
|
||
| Priority order: | ||
| 1. XDG_RUNTIME_DIR/containerd/containerd.sock (rootless containerd) | ||
| 2. XDG_RUNTIME_DIR/finch.sock (Finch-specific) | ||
| 3. ~/.finch/finch.sock (user home directory) | ||
| 4. /var/run/finch.sock (system-wide) | ||
|
|
||
| Returns: | ||
| Optional[str]: Socket path if found, None otherwise | ||
| """ | ||
|
|
||
| # Check XDG_RUNTIME_DIR for rootless containerd | ||
| xdg_runtime_dir = os.environ.get("XDG_RUNTIME_DIR") | ||
| if xdg_runtime_dir: | ||
| # Rootless containerd socket (most common on Linux) | ||
| containerd_sock = os.path.join(xdg_runtime_dir, "containerd", "containerd.sock") | ||
| if os.path.exists(containerd_sock): | ||
| LOG.debug(f"Found Finch socket at XDG_RUNTIME_DIR: {containerd_sock}") | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is the |
||
| return f"unix://{containerd_sock}" | ||
|
|
||
| # Finch-specific socket in XDG_RUNTIME_DIR | ||
| finch_sock = os.path.join(xdg_runtime_dir, "finch.sock") | ||
| if os.path.exists(finch_sock): | ||
| LOG.debug(f"Found Finch socket at XDG_RUNTIME_DIR: {finch_sock}") | ||
| return f"unix://{finch_sock}" | ||
|
|
||
| # Check user home directory for Finch VM socket | ||
| home_dir = os.path.expanduser("~") | ||
| home_finch_sock = os.path.join(home_dir, ".finch", "finch.sock") | ||
| if os.path.exists(home_finch_sock): | ||
| LOG.debug(f"Found Finch socket in home directory: {home_finch_sock}") | ||
| return f"unix://{home_finch_sock}" | ||
|
|
||
| # System-wide socket (fallback) | ||
| system_sock = "/var/run/finch.sock" | ||
| if os.path.exists(system_sock): | ||
| LOG.debug(f"Found Finch socket at system location: {system_sock}") | ||
| return f"unix://{system_sock}" | ||
|
|
||
| # No socket found - return None to enable future CLI fallback | ||
| LOG.debug("No Finch socket found in standard locations") | ||
|
robbrad marked this conversation as resolved.
Outdated
|
||
| return None | ||
|
|
||
| def supports_finch(self) -> bool: | ||
| """ | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.