Skip to content

Commit 64b387c

Browse files
committed
pkg/bridge: remove uses of go-connections
Signed-off-by: Sebastiaan van Stijn <[email protected]>
1 parent 62ab36a commit 64b387c

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ require (
2020
github.com/docker/cli v29.1.1+incompatible
2121
github.com/docker/cli-docs-tool v0.10.0
2222
github.com/docker/docker v28.5.2+incompatible
23-
github.com/docker/go-connections v0.6.0
2423
github.com/docker/go-units v0.5.0
2524
github.com/eiannone/keyboard v0.0.0-20220611211555-0d226195f203
2625
github.com/fsnotify/fsevents v0.2.0
@@ -77,6 +76,7 @@ require (
7776
github.com/cpuguy83/go-md2man/v2 v2.0.7 // indirect
7877
github.com/davecgh/go-spew v1.1.1 // indirect
7978
github.com/docker/docker-credential-helpers v0.9.4 // indirect
79+
github.com/docker/go-connections v0.6.0 // indirect
8080
github.com/felixge/httpsnoop v1.0.4 // indirect
8181
github.com/fvbommel/sortorder v1.1.0 // indirect
8282
github.com/go-logr/logr v1.4.3 // indirect

pkg/bridge/convert.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ import (
3030
"github.com/containerd/errdefs"
3131
"github.com/docker/cli/cli/command"
3232
cli "github.com/docker/cli/cli/command/container"
33-
"github.com/docker/go-connections/nat"
3433
"github.com/moby/moby/api/types/container"
3534
"github.com/moby/moby/api/types/image"
3635
"github.com/moby/moby/api/types/network"
@@ -164,7 +163,11 @@ func LoadAdditionalResources(ctx context.Context, dockerCLI command.Cli, project
164163
exposed := utils.Set[string]{}
165164
exposed.AddAll(service.Expose...)
166165
for port := range inspect.Config.ExposedPorts {
167-
exposed.Add(nat.Port(port).Port())
166+
p, err := network.ParsePort(port)
167+
if err != nil {
168+
return nil, err
169+
}
170+
exposed.Add(strconv.Itoa(int(p.Num())))
168171
}
169172
for _, port := range service.Ports {
170173
exposed.Add(strconv.Itoa(int(port.Target)))

0 commit comments

Comments
 (0)