Skip to content

Commit 8193d86

Browse files
thaJeztahndeloof
authored andcommitted
pkg/bridge: remove uses of go-connections
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
1 parent bfb5511 commit 8193d86

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
@@ -18,7 +18,6 @@ require (
1818
github.com/docker/cli v29.2.1+incompatible
1919
github.com/docker/cli-docs-tool v0.11.0
2020
github.com/docker/docker v28.5.2+incompatible
21-
github.com/docker/go-connections v0.6.0
2221
github.com/docker/go-units v0.5.0
2322
github.com/eiannone/keyboard v0.0.0-20220611211555-0d226195f203
2423
github.com/fsnotify/fsevents v0.2.0
@@ -75,6 +74,7 @@ require (
7574
github.com/davecgh/go-spew v1.1.1 // indirect
7675
github.com/docker/distribution v2.8.3+incompatible // indirect
7776
github.com/docker/docker-credential-helpers v0.9.5 // indirect
77+
github.com/docker/go-connections v0.6.0 // indirect
7878
github.com/felixge/httpsnoop v1.0.4 // indirect
7979
github.com/fvbommel/sortorder v1.1.0 // indirect
8080
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"
@@ -175,7 +174,11 @@ func LoadAdditionalResources(ctx context.Context, dockerCLI command.Cli, project
175174
exposed := utils.Set[string]{}
176175
exposed.AddAll(service.Expose...)
177176
for port := range inspect.Config.ExposedPorts {
178-
exposed.Add(nat.Port(port).Port())
177+
p, err := network.ParsePort(port)
178+
if err != nil {
179+
return nil, err
180+
}
181+
exposed.Add(strconv.Itoa(int(p.Num())))
179182
}
180183
for _, port := range service.Ports {
181184
exposed.Add(strconv.Itoa(int(port.Target)))

0 commit comments

Comments
 (0)