From f0049190d7ce3907654e3507dba4a79c77f50302 Mon Sep 17 00:00:00 2001 From: jochen Date: Tue, 22 Sep 2026 23:29:28 +0200 Subject: [PATCH] Prove the untouched environment is the same map, not an equal one --- internal/catalogue/port_into_test.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/internal/catalogue/port_into_test.go b/internal/catalogue/port_into_test.go index 8f3c2f4..1e13cb5 100644 --- a/internal/catalogue/port_into_test.go +++ b/internal/catalogue/port_into_test.go @@ -162,7 +162,9 @@ func TestAContainerWithNoPortPlaceholderKeepsItsEnvironment(t *testing.T) { if got := sidecar["env"].(map[string]any)["MESH_GITEA_URL"]; got != "http://gitea:3000" { t.Fatalf("an address on the runtime's own network was moved to the machine's port: %v", got) } - if !reflect.DeepEqual(sidecar["env"], env) { + // The same map, not a copy of it: a container that asks for nothing is left alone, and + // comparing the contents would say yes even to a rebuilt map. + if reflect.ValueOf(sidecar["env"]).Pointer() != reflect.ValueOf(env).Pointer() { t.Fatalf("a container that asked for nothing had its environment rebuilt: %v", sidecar["env"]) } }