Prove the untouched environment is the same map, not an equal one
This commit is contained in:
@@ -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"])
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user