fix: skip read-only mounts in permission fixer and remove redundant ssh_keys manifest mount

- apply_mount_permissions now skips mounts with readonly=true to avoid
  'Read-only file system' warnings on post-start chown/chmod
- Removed the ssh_keys mount from the pi-agent manifest definition;
  instance-level SSH key mounting now handles this exclusively
- Added unit test for read-only mount skipping

Quality gates: pytest (15 passed)
This commit is contained in:
Alex Blank
2026-05-29 15:32:00 +02:00
parent de8c47c81c
commit b483a34517
4 changed files with 32 additions and 9 deletions
+3 -1
View File
@@ -1347,7 +1347,9 @@ async def start_instance(
ToolDefinitionManifest, manifest_def.base_definition_id
)
if base_def:
manifest = resolve_base(deep_merge(dict(base_def.manifest), manifest))
manifest = resolve_base(
deep_merge(dict(base_def.manifest), manifest)
)
home_dir = get_manifest_home_dir(manifest)
user_cfg = manifest.get("user")
if user_cfg:
+11
View File
@@ -40,6 +40,17 @@ def apply_mount_permissions(
"error": None,
}
# Skip read-only mounts — their permissions cannot be changed
# post-start because the bind mount is locked.
if mount.get("readonly", False):
logger.debug(
"Skipping permission fix for read-only mount %s (target=%s)",
name,
target,
)
results.append(result)
continue
# Skip if no permission policy defined
if not owner and not mode and not file_mode:
results.append(result)