From e7721e8155ca28b1f488eddbb1d2a9856ff4ac68 Mon Sep 17 00:00:00 2001 From: Abhishek Sah Date: Mon, 12 Jan 2026 15:37:28 +0530 Subject: [PATCH] fix: change env prefix to avoid K8s service env var collision Change env prefix from FRONTIER to FRONTIER_SERVICE to prevent collision with Kubernetes service environment variables. K8s automatically creates env vars for services (e.g., FRONTIER_APP_PORT for a service named frontier-app). With Viper's FRONTIER prefix, this maps to app.port and overrides config file values with invalid URLs like "tcp://172.20.58.102:80". With FRONTIER_SERVICE prefix, env vars need to be FRONTIER_SERVICE_APP_PORT to affect app.port, avoiding the collision. Co-Authored-By: Claude Opus 4.5 --- config/config.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/config/config.go b/config/config.go index ab727d570..76b74eaa8 100644 --- a/config/config.go +++ b/config/config.go @@ -35,7 +35,9 @@ func Load(serverConfigFileFromFlag string) (*Frontier, error) { conf := &Frontier{} var options []config.Option - options = append(options, config.WithEnvPrefix("FRONTIER")) + // use FRONTIER_SERVICE_ prefix to avoid collision with K8s service env vars + // K8s auto-creates env vars like FRONTIER_APP_PORT for service named frontier-app + options = append(options, config.WithEnvPrefix("FRONTIER_SERVICE")) // override all config sources and prioritize one from file if serverConfigFileFromFlag != "" {