Fix double detection bug.

This commit is contained in:
Greyscale 2022-08-09 03:09:25 +01:00
parent cbb1670702
commit 9894f68a6b
No known key found for this signature in database
GPG key ID: CEC4822A25BA80C5

View file

@ -433,7 +433,7 @@ class Bouncer
// $valid ? 'is valid' : 'is not valid'
// ));
if ($valid) {
$bouncerTargets[] = $bouncerTarget;
$bouncerTargets[$bouncerTarget->getDomains()[0]] = $bouncerTarget;
}
}
}
@ -495,7 +495,7 @@ class Bouncer
// $valid ? 'is valid' : 'is not valid'
// ));
if ($valid) {
$bouncerTargets[] = $bouncerTarget;
$bouncerTargets[$bouncerTarget->getDomains()[0]] = $bouncerTarget;
}
}
}
@ -633,9 +633,11 @@ class Bouncer
$this->logger->info(sprintf('%s Swarm mode is %s.', Emoji::CHARACTER_HONEYBEE, $this->isSwarmMode() ? 'enabled' : 'disabled'));
$targets = array_merge(
$this->findContainersContainerMode(),
$this->isSwarmMode() ? $this->findContainersSwarmMode() : []
$targets = array_values(
array_merge(
$this->findContainersContainerMode(),
$this->isSwarmMode() ? $this->findContainersSwarmMode() : []
)
);
$this->wipeNginxConfig();