Skip to content

Commit 83a2a8d

Browse files
committed
copy network cfg in container recreation
1 parent 7045b25 commit 83a2a8d

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

systemtest/containers.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ import (
3737
"github.com/docker/docker/api/types"
3838
"github.com/docker/docker/api/types/container"
3939
"github.com/docker/docker/api/types/filters"
40+
"github.com/docker/docker/api/types/network"
4041
"github.com/docker/docker/client"
4142
"github.com/docker/docker/pkg/stdcopy"
4243
"github.com/docker/go-connections/nat"
@@ -520,7 +521,9 @@ func ToggleGeoIpDatabase(ctx context.Context, available bool) error {
520521
ctx,
521522
cfgCopy,
522523
hostCfgCopy,
523-
nil,
524+
&network.NetworkingConfig{
525+
EndpointsConfig: inspect.NetworkSettings.Networks,
526+
},
524527
nil,
525528
inspect.Name,
526529
)
@@ -541,8 +544,6 @@ func ToggleGeoIpDatabase(ctx context.Context, available bool) error {
541544
return fmt.Errorf("starting kibana container: %w", err)
542545
}
543546

544-
log.Printf("Container recreated (Id: %s) with GeoIp mount enabled. Kibana restarted\n", createResp.ID[:5])
545-
546547
return waitContainerHealthy(ctx, "kibana")
547548
}
548549

0 commit comments

Comments
 (0)