bascule-gateway: fix env-prefix separator + embedded accord parse
Two bugs surfaced when bascule-gateway pods first reached Running and
attempted config load (F.4 deployment):
1. Env-var override didn't take effect for any BASCULE_* variable.
config::Environment::with_prefix("BASCULE") without an explicit
prefix_separator strips the literal "BASCULE" with no separator,
so BASCULE_ACCORD_PATH became "_ACCORD_PATH" (leading underscore)
which doesn't match the field "accord_path". Result: every env
override silently fell back to the default in config.rs, and the
pod read /accord/accord.yaml instead of /etc/bascule/accord.yaml
from the configured volume. Adds .prefix_separator("_") to match
QM's pattern in services/quartermaster/src/config.rs:150.
2. Embedded fallback accord YAML had `sampled: []` and a stray
`sampleRate: 1`, but the schema has
`sampled: Option<SampledConfig {events, sample_rate}>` — empty
list mis-parses as struct. Result: when accord file lookup failed,
the .expect("empty accord must parse") panicked, crashing the
bascule-gateway container. Now omitted (Option default None).
Both fixes verified against accord-core's schema in
services/accord-core/src/schema.rs.
Signed-off-by: Tyler J King <tking@guildhouse.dev>
This commit is contained in:
parent
2cfc0b4d5e
commit
eab96ef3d4
2 changed files with 3 additions and 2 deletions
|
|
@ -121,6 +121,7 @@ impl BasculeConfig {
|
|||
let config = config::Config::builder()
|
||||
.add_source(
|
||||
config::Environment::with_prefix("BASCULE")
|
||||
.prefix_separator("_")
|
||||
.separator("__")
|
||||
.try_parsing(true),
|
||||
)
|
||||
|
|
|
|||
|
|
@ -69,8 +69,8 @@ spec:
|
|||
fidelity: always_notarize
|
||||
notarize: []
|
||||
logOnly: []
|
||||
sampled: []
|
||||
sampleRate: 1
|
||||
# sampled omitted — Option<SampledConfig> default None (struct shape:
|
||||
# {events: [...], sample_rate: N}), `sampled: []` would mis-parse.
|
||||
reconciliation:
|
||||
defaultWindow: "24h"
|
||||
onExpiry: alert
|
||||
|
|
|
|||
Loading…
Reference in a new issue