feat(multiplayer): propagate allocated launch configuration

This commit is contained in:
Josh Creek
2026-09-01 16:57:27 +01:00
parent 75cb8faac4
commit 315c524c42
5 changed files with 97 additions and 1 deletions
+6
View File
@@ -32,6 +32,12 @@ func TestAllocateBuildsStrictGameServerAllocationAndEndpoint(t *testing.T) {
if body.Spec.Metadata.Annotations["cosmic-clash.io/match-id"] != "match-1" || body.Spec.Metadata.Annotations["cosmic-clash.io/allocation-id"] != "allocation-1" {
t.Fatalf("allocation did not request match/allocation ID annotations on the GameServer: %+v", body.Spec.Metadata.Annotations)
}
want := map[string]string{"cosmic-clash.io/region": "EU", "cosmic-clash.io/build": "build-1", "cosmic-clash.io/protocol": "1", "cosmic-clash.io/transport": "enet"}
for key, value := range want {
if body.Spec.Metadata.Annotations[key] != value {
t.Fatalf("annotation %s = %q, want %q", key, body.Spec.Metadata.Annotations[key], value)
}
}
w.Header().Set("Content-Type", "application/json")
_, _ = w.Write([]byte(`{"status":{"state":"Allocated","gameServerName":"gs-a","address":"2001:db8::1","ports":[{"name":"default","port":7777}]}}`))
}))