|
| 1 | +--- |
| 2 | +summary: Accept the service `tmpfs` key, emitted as podman `--tmpfs <path>[:<options>]`. |
| 3 | +--- |
| 4 | + |
| 5 | +# Change: Support the service `tmpfs` key |
| 6 | + |
| 7 | +**Lane:** lightweight — two files (`parsing.py`, `emit.py`), no new file, no |
| 8 | +public-API change, single straightforward pass-through (verified against |
| 9 | +podman's own flag docs, no design ambiguity). |
| 10 | + |
| 11 | +## Goal |
| 12 | + |
| 13 | +`validate()` rejects the service `tmpfs` key |
| 14 | +(`service 'agent-worker': unsupported key 'tmpfs'`). Compose's `tmpfs:` short |
| 15 | +syntax (a string or list of strings, each `<path>` or `<path>:<options>`, e.g. |
| 16 | +`/tmp:mode=1777`) maps directly onto podman's own `--tmpfs |
| 17 | +CONTAINER-DIR[:OPTIONS]` flag — confirmed against podman's `podman-run` docs: |
| 18 | +"The general format is: `--tmpfs CONTAINER-DIR[:OPTIONS]`" with the same |
| 19 | +`mode=`/`size=` option vocabulary Compose uses. This is a pure pass-through, |
| 20 | +unlike volumes: no host-path translation, no bind-vs-named disambiguation. |
| 21 | + |
| 22 | +## Approach |
| 23 | + |
| 24 | +- `parsing.py`: add `"tmpfs"` to `SUPPORTED_SERVICE_KEYS`. No dedicated |
| 25 | + validation — `tmpfs` is a string or list of strings; malformed option |
| 26 | + strings surface as a podman error at run time, consistent with how other |
| 27 | + pass-through values (image names, volume names) are handled. |
| 28 | +- `emit.py` (`run_flags`): normalize `svc.get("tmpfs")` to a list the same way |
| 29 | + `env_file` already is (`str` → single-element list), then append |
| 30 | + `["--tmpfs", value]` for each entry, verbatim. |
| 31 | +- Promote into `architecture/supported-subset.md`. |
| 32 | + |
| 33 | +## Files |
| 34 | + |
| 35 | +- `compose2pod/parsing.py` — add `tmpfs` to `SUPPORTED_SERVICE_KEYS`. |
| 36 | +- `compose2pod/emit.py` — `run_flags`: emit `--tmpfs <value>` per entry. |
| 37 | +- `tests/test_parsing.py` — `tmpfs` (string and list forms) validates. |
| 38 | +- `tests/test_emit.py` — `run_flags` emits `--tmpfs` for both forms. |
| 39 | +- `architecture/supported-subset.md` — Service keys promotion. |
| 40 | + |
| 41 | +## Verification |
| 42 | + |
| 43 | +- [ ] Failing test first: `run_flags` with `tmpfs: ["/tmp:mode=1777"]` — no |
| 44 | + `--tmpfs` flag present (RED). |
| 45 | +- [ ] Apply the `parsing.py` + `emit.py` changes. |
| 46 | +- [ ] Test passes: `["--tmpfs", "/tmp:mode=1777"]` present in flags. |
| 47 | +- [ ] `just test-ci` — full suite green at 100% line coverage. |
| 48 | +- [ ] `just lint-ci` — clean. |
0 commit comments