Profile [env.*] cannot override LOCALSTACK_HOST (launcher value appended last)
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 78/100
Direzione di ricerca
Inizia in internal/container/start.go, intorno all’assemblaggio dell’ambiente alle righe 266–296; confronta il controllo di SF_S3_ENDPOINT e l’avviso per MAIN_CONTAINER_NAME con il modo in cui viene aggiunto LOCALSTACK_HOST. Controlla i test vicini sulla costruzione dell’ambiente del container, quindi aggiungi la copertura per un LOCALSTACK_HOST fornito dal profilo. Il lavoro è completato quando il valore del profilo viene rispettato oppure un avviso chiaro spiega che viene ignorato, e il comportamento scelto è testato.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Observed
Setting LOCALSTACK_HOST in a config [env.*] profile has no effect. The container receives the variable twice — the profile value first, lstk's computed value second — and Docker's last-wins semantics keep lstk's. docker inspect on a type = "snowflake" container started with a profile containing LOCALSTACK_HOST = "sf.example.test:4599" shows both entries; the emulator sees localhost.localstack.cloud:4599. Nothing warns that the profile value was dropped.
Where
internal/container/start.go on main (d9c83037):
:276env := resolvedEnv— the profile's variables come first;:281-285env = append(env, "GATEWAY_LISTEN=…", "MAIN_CONTAINER_NAME=…", "LOCALSTACK_HOST="+endpoint.Hostname+":"+c.Port)— lstk's own value is appended unconditionally after them.
The two neighbours already handle this collision: SF_S3_ENDPOINT (:292) is appended only when the profile did not set it (!envHasKey(resolvedEnv, "SF_S3_ENDPOINT")), and MAIN_CONTAINER_NAME (:266-275) emits a warning saying the profile value is ignored. LOCALSTACK_HOST does neither, so the profile value vanishes silently. (A LOCALSTACK_HOST exported in the host shell does win, because hostEnv is appended at :296 after lstk's line — so the two configuration channels behave differently.)
Context
Recorded in September 2026 while diagnosing a snowflake-next result-chunk 404 under lstk (the emulator advertised the host lstk injected but its hostname gate did not route it; that was fixed on the emulator side, which now routes any host it is told to advertise). For the default flow this is harmless: the value lstk injects, localhost.localstack.cloud:<published port>, is the right one. It only matters when a user needs a different advertised host — a non-loopback hostname for clients on other machines, or a reverse-proxy name — and reaches for the documented [env.*] mechanism to set it.
Expected
Either the profile wins — append lstk's LOCALSTACK_HOST only when the profile did not set it, with the same envHasKey guard SF_S3_ENDPOINT uses — or lstk warns that the profile value is ignored, as it does for MAIN_CONTAINER_NAME, and the config docs state that LOCALSTACK_HOST is launcher-owned.
Reproduce
[[containers]]
type = "snowflake"
port = "4599"
env = ["custom"]
[env.custom]
LOCALSTACK_HOST = "sf.example.test:4599"
lstk start, then docker inspect <container> --format '{{json .Config.Env}}' → both LOCALSTACK_HOST=sf.example.test:4599 and LOCALSTACK_HOST=localhost.localstack.cloud:4599, in that order; inside the container echo $LOCALSTACK_HOST prints the latter.
- Lingua principale
- Go
- Stelle
- 38
- Fork
- 8
- Merge medio
- 1g 4h
- PR unite (30g)
- 29
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di localstack/lstk
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 57/100
localstack/lstk#541 · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di localstack/lstk
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
I maintainer di solito rispondono entro 1 giorno
-
os: RawConn methods of a closed File return internal/poll.ErrFileClosing instead of ErrClosedAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
[Bug]: Bedrock invoke-with-response-stream reports `stop_reason: "end_turn"` for tool-use turnsAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
oalders/clodhopper#162 ·
I maintainer di solito rispondono entro 1 giorno
-
component/server severity/minor type/bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno