Skip to content

fix(plannings): follow symlinks when scanning plannings dir#200

Open
kernoeb wants to merge 1 commit into
mainfrom
fix/plannings-follow-symlinks
Open

fix(plannings): follow symlinks when scanning plannings dir#200
kernoeb wants to merge 1 commit into
mainfrom
fix/plannings-follow-symlinks

Conversation

@kernoeb

@kernoeb kernoeb commented Jun 18, 2026

Copy link
Copy Markdown
Owner

Problem

When the plannings directory is overwritten via a Kubernetes ConfigMap volume mount, every file is exposed as a symlink:

imt-atlantique.json -> ..data/imt-atlantique.json
..data              -> ..2026_06_18_09_03_30.3915035025/

Bun.Glob.scan defaults to followSymlinks: false, so with onlyFiles: true these symlinked entries are skipped → 0 plannings loaded (server starts fine, but the planning tree is empty).

Fix

Pass followSymlinks: true to the glob.scan(...) in apps/api/src/plannings/index.ts.

Verification

Reproduced the exact ConfigMap symlink layout (..data + per-file symlinks) and ran the glob both ways:

scan result
followSymlinks: false (before) 0 files
followSymlinks: true (after) 1 file

Reading the resolved path right after (Bun.file(file).json()) follows the symlink transparently, so no other change is needed. The non-symlink case is unaffected. Typecheck + lint pass.

Notes for K8s users

Without this change, alternatives that need no code change are: mount each file with subPath: (real bind-mounted file), or set PLANNINGS_LOCATION=/app/plannings/..data (the inner files are real).

🤖 Generated with Claude Code

Bun's Glob.scan defaults to followSymlinks: false, so files mounted as
symlinks were skipped and 0 plannings loaded. Kubernetes ConfigMap volume
mounts expose every file as a symlink (file.json -> ..data/file.json),
which made directory-overwrite mounts find nothing.

Enable followSymlinks so ConfigMap-mounted plannings are discovered.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.

1 participant