fix: bind KANDEV_AGENT_STANDALONE_PORT env var to config (#61)
This commit is contained in:
@@ -193,6 +193,12 @@ func LoadWithPath(configPath string) (*Config, error) {
|
||||
v.SetEnvKeyReplacer(strings.NewReplacer(".", "_"))
|
||||
v.AutomaticEnv()
|
||||
|
||||
// Explicit bindings for snake_case env vars (camelCase config keys)
|
||||
// AutomaticEnv does not handle camelCase to SNAKE_CASE conversion,
|
||||
// so we explicitly bind keys where env var naming differs from config key naming.
|
||||
_ = v.BindEnv("agent.standalonePort", "KANDEV_AGENT_STANDALONE_PORT")
|
||||
_ = v.BindEnv("agent.standaloneHost", "KANDEV_AGENT_STANDALONE_HOST")
|
||||
|
||||
// Configure config file
|
||||
v.SetConfigName("config")
|
||||
v.SetConfigType("yaml")
|
||||
|
||||
Reference in New Issue
Block a user