Skip to content

Commit dc8ef89

Browse files
committed
fix: make sure server won't attach wireport-net to the gateway container 2
1 parent 48b7327 commit dc8ef89

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

app/internal/dockerutils/service.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"context"
55
"fmt"
66
"os"
7+
"slices"
78
"strings"
89
"wireport/cmd/server/config"
910
"wireport/internal/logger"
@@ -157,11 +158,11 @@ func EnsureDockerNetworkIsAttachedToAllContainers() error {
157158
}
158159

159160
for _, container := range containers {
160-
// Skip wireport-gateway container (should not be connected to the network)
161-
for _, name := range container.Names {
162-
if name == fmt.Sprintf("/%s", config.Config.WireportGatewayContainerName) {
163-
continue
164-
}
161+
isGateway := slices.Contains(container.Names, fmt.Sprintf("/%s", config.Config.WireportGatewayContainerName))
162+
163+
if isGateway {
164+
// Skip wireport-gateway container (should not be connected to the network)
165+
continue
165166
}
166167

167168
// Skip containers that are already connected to the target network to avoid conflicts

0 commit comments

Comments
 (0)