fix(registry-cache): create cache dirs via StateDirectory #3

Merged
yuuhikaze merged 1 commit from :fix/registry-cache-statedir into master 2026-10-24 11:20:41 -05:00

Both units failed with 226/NAMESPACE: Failed to set up mount namespacing: /var/lib/registry-cache/docker-io: No such file or directory. tmpfiles created the per-cache dirs on the tmpfs root before the /persist bind mount covered /var/lib/registry-cache, so ReadWritePaths pointed at nothing.

Now StateDirectory=registry-cache/<name> (created by systemd inside the mounted dir at start, writable under ProtectSystem=strict) + RequiresMountsFor; tmpfiles rules dropped.

Tested live with systemd-run and the same binary, config and sandbox properties: unit active, /v2/_catalog 200, pull-through library/alpine:3 manifest 200, dir registry-cache:registry-cache 0750 under the persisted mount.

After merge: rebuild, then the Talos patch mc step from #2.

🤖 Generated with Claude Code

Both units failed with `226/NAMESPACE`: `Failed to set up mount namespacing: /var/lib/registry-cache/docker-io: No such file or directory`. tmpfiles created the per-cache dirs on the tmpfs root before the `/persist` bind mount covered `/var/lib/registry-cache`, so `ReadWritePaths` pointed at nothing. Now `StateDirectory=registry-cache/<name>` (created by systemd inside the mounted dir at start, writable under `ProtectSystem=strict`) + `RequiresMountsFor`; tmpfiles rules dropped. **Tested live** with `systemd-run` and the same binary, config and sandbox properties: unit active, `/v2/_catalog` 200, pull-through `library/alpine:3` manifest 200, dir `registry-cache:registry-cache 0750` under the persisted mount. After merge: `rebuild`, then the Talos `patch mc` step from #2. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
tmpfiles created them before /var/lib/registry-cache was bind-mounted
from /persist, so the mount hid them and both units failed with
226/NAMESPACE on missing ReadWritePaths.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Tt5Kc71LcLjqfyZWoZosqh
yuuhikaze merged commit 5325b798f4 into master 2026-10-24 11:20:41 -05:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
yuuhikaze/nixos!3
No description provided.