Fix ZFS pool detection: bind-mount host zpool binary and libs

This commit is contained in:
2026-03-07 03:46:56 +00:00
parent 861f9279c4
commit 4c033981c1
2 changed files with 9 additions and 7 deletions

View File

@@ -4,6 +4,9 @@ import logging
logger = logging.getLogger(__name__)
# Allow overriding the zpool binary path via env (for bind-mounted host tools)
ZPOOL_BIN = os.environ.get("ZPOOL_BIN", "zpool")
async def get_zfs_pool_map() -> dict[str, str]:
"""Return a dict mapping device names to ZFS pool names.
@@ -13,7 +16,7 @@ async def get_zfs_pool_map() -> dict[str, str]:
pool_map = {}
try:
proc = await asyncio.create_subprocess_exec(
"zpool", "status", "-P",
ZPOOL_BIN, "status", "-P",
stdout=asyncio.subprocess.PIPE,
stderr=asyncio.subprocess.PIPE,
)