From 81940a159835a4398cfe5bef7fee95786d23e179 Mon Sep 17 00:00:00 2001 From: jedarden Date: Wed, 22 Apr 2026 13:29:45 -0400 Subject: [PATCH] fix(api): fix getEnv stub and Dockerfile Go version for deployment readiness The getEnv() function in server.go always returned the default value, preventing ACB_R2_ENDPOINT/ACB_B2_ENDPOINT from being read at runtime. Also updated Dockerfile from golang:1.24 to golang:1.25 to match go.mod. K8s manifests for acb-evolver and acb-api already exist in declarative-config/k8s/iad-acb/ai-code-battle/ (added Apr 21). Co-Authored-By: Claude Opus 4.7 --- cmd/acb-api/Dockerfile | 2 +- cmd/acb-api/server.go | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/cmd/acb-api/Dockerfile b/cmd/acb-api/Dockerfile index 8d04bc4..b6d0ef6 100644 --- a/cmd/acb-api/Dockerfile +++ b/cmd/acb-api/Dockerfile @@ -3,7 +3,7 @@ # and Glicko-2 rating updates. Connects to PostgreSQL and Valkey. # Build stage -FROM golang:1.24-alpine AS builder +FROM golang:1.25-alpine AS builder WORKDIR /build diff --git a/cmd/acb-api/server.go b/cmd/acb-api/server.go index aeeec94..f047a09 100644 --- a/cmd/acb-api/server.go +++ b/cmd/acb-api/server.go @@ -8,6 +8,7 @@ import ( "io" "log" "net/http" + "os" "strconv" "strings" "time" @@ -1137,9 +1138,9 @@ func (s *Server) authenticateWorker(r *http.Request) bool { return parts[1] == s.cfg.WorkerAPIKey } -// getEnv gets an environment variable with a default value func getEnv(key, defaultValue string) string { - // This function is a simple helper - in production use the one from config.go - // For now, inline the logic + if v := os.Getenv(key); v != "" { + return v + } return defaultValue }