From 9894f68a6b6709ad340ff904e79684d2642cdb38 Mon Sep 17 00:00:00 2001 From: Matthew Baggett Date: Tue, 9 Aug 2022 03:09:25 +0100 Subject: [PATCH] Fix double detection bug. --- bouncer/bouncer | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/bouncer/bouncer b/bouncer/bouncer index cc05ec5..2447ca9 100755 --- a/bouncer/bouncer +++ b/bouncer/bouncer @@ -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();