Skip to content

Commit 4004ae4

Browse files
committed
Update RFC to handle config directories
docs(rfc): address conf.d pattern and remove stale scratch branch reference Closes out open question #2 with a conf.d-style directory loader as a planned follow-on to the v1 single-file approach. Documents the three design decisions needed before implementation. Removes reference to scratch/server-config-file branch which does not exist.
1 parent d70a571 commit 4004ae4

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

‎rfc/0002-gateway-configuration/README.md‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ The chart renders this into a `ConfigMap` mounted at `/etc/openshell/gateway.tom
183183

184184
## Implementation plan
185185

186-
The implementation is already prototyped on the `scratch/server-config-file` branch. The remaining work to reach merge-ready state:
186+
The remaining work to reach merge-ready state:
187187

188188
1. **Review and clean up `gateway_config_file.rs`** — the merge logic and TOML schema are implemented; polish error messages and add inline documentation.
189189
2. **Extend test coverage** — add tests for TLS merge paths, partial-TLS error, health-port collision, and unknown-field rejection.
@@ -214,5 +214,7 @@ The implementation is already prototyped on the `scratch/server-config-file` bra
214214
## Open questions
215215

216216
1. **Schema versioning** — the `version` field is reserved but not acted on. Should the parser reject files with `version > 1`, or just warn? Define this before the first stable release.
217-
2. **Multiple config files / layering** — should the gateway support a system-level config at `/etc/openshell/gateway.toml` and a user-level override? Probably not needed initially, but worth deciding before the format is widely adopted.
217+
2. **Directory-based config (`conf.d` pattern)** — a `--config-dir` flag that globs all `*.toml` files in a directory, sorts them alphabetically, and deep-merges them in order (later files win per key). CLI/env overrides still sit above everything. This maps cleanly to Kubernetes: a base `ConfigMap` as `10-base.toml`, driver config as `20-kubernetes.toml`, and credentials from a projected `Secret` as `90-credentials.toml` — all mounted into the same directory without a monolithic file. This is the approach taken by cri-o and kubelet, inspired by systemd's `conf.d` convention.
218+
219+
Deferred to a follow-on: the single `--config` file is sufficient for v1, and the directory loader can be added without any schema changes. Before implementing, three design decisions must be settled: (a) whether `--config` and `--config-dir` are mutually exclusive or composable and if so which takes lower precedence; (b) whether a later file's array value (e.g. `compute_drivers`) replaces or appends — replace is simpler and less surprising; (c) `deny_unknown_fields` validation must apply to the final merged result rather than each individual file, since partial drop-in files won't contain all sections.
218220
3. **`database_url` as a secret** — should `database_url` be excluded from the TOML file schema and forced through environment / secrets injection to prevent accidental plaintext commits? Or is the operator's responsibility sufficient?

0 commit comments

Comments
 (0)