Docker: alte Server ohne passenden Host-Namen über die Adresse finden

This commit is contained in:
mregosar committed 2026-10-29 13:54:46 +01:00
1 parent 3040124b33
commit b616bbafc1
2 files changed
+18 -4

No files matched your search

+5 -2
View File
@@ -378,8 +378,11 @@ export class DockerHostPool {
adapterFor(handle) {
const name = handle?.hostName ?? this.hosts[0].name;
const adapter = this.adapters.get(name);
if (!adapter) throw new Error(`Docker-Host "${name}" ist nicht (mehr) konfiguriert`);
return adapter;
if (adapter) return adapter;
// Server aus der Zeit vor der Host-Liste (Name "default") oder nach einer Umbenennung: über die Adresse finden
const byAddress = handle?.rconHost && this.hosts.find((h) => h.rconHost === handle.rconHost || h.publicHost === handle.rconHost);
if (byAddress) return this.adapters.get(byAddress.name);
throw new Error(`Docker-Host "${name}" ist nicht (mehr) konfiguriert`);
}
async status(handle) {