Repository navigation
Commit 696fa36
committed
feat(gateway): merge drop-in configs over the base file
Load `*.toml` drop-in configs from a directory and merge them over the
base config in lexical order, so operators and packages can customize a
gateway without editing the base file. Select the directory with
`--config-dir` or `OPENSHELL_GATEWAY_CONFIG_DIR`, or let the gateway use
`gateway.d` beside the base file. An empty value turns drop-in configs
off. `--config` and `--config-dir` compose.
Tables merge key by key; scalars and arrays replace; a drop-in cannot
unset a key. Every file must declare `[openshell] version = 2` as an
integer, but a drop-in may set only some keys of a table. The merged
result is validated once. An error names the file that sets the
offending key, with its line and column for a single file and its key
path for several. Errors that no single key explains, such as a missing
required key or a rule over a table that several files set, name the
merged configuration and its files. Unknown keys are rejected.
Follow a drop-in symlink only when it resolves inside the drop-in
directory, which covers Kubernetes ConfigMap mounts, and keep the base
file strict. Treat a `gateway.d` with no drop-in configs and no base
file as no configuration. `load` and `preflight` use the same loader,
`config preflight` lists the files it merged, and the gateway logs them
at startup.
Signed-off-by: Evan Lezar <elezar@nvidia.com>1 parent e1920f0 commit 696fa36
10 files changed
Lines changed: 1475 additions & 122 deletions
File tree
- crates/openshell-server
- src
- config_file
- deploy
- man
- rpm
- docs/how-it-works/gateways
- skills/debug-openshell-cluster
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
| 95 | + | |
95 | 96 | | |
96 | 97 | | |
97 | 98 | | |
| |||
0 commit comments