Skip to content

Commit 369c2cc

Browse files
committed
Add protocol to port info
1 parent 44b38cf commit 369c2cc

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

docker-gen.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,9 @@ type Address struct {
3939
IP string
4040
Port string
4141
HostPort string
42+
Proto string
4243
}
44+
4345
type RuntimeContainer struct {
4446
ID string
4547
Addresses []Address

docker_client.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,8 +220,9 @@ func getContainers(client *docker.Client) ([]*RuntimeContainer, error) {
220220
}
221221
for k, v := range container.NetworkSettings.Ports {
222222
address := Address{
223-
IP: container.NetworkSettings.IPAddress,
224-
Port: k.Port(),
223+
IP: container.NetworkSettings.IPAddress,
224+
Port: k.Port(),
225+
Proto: k.Proto(),
225226
}
226227
if len(v) > 0 {
227228
address.HostPort = v[0].HostPort

0 commit comments

Comments
 (0)