Skip to content

Commit f15d719

Browse files
committed
feat: add IP binding display in ls
1 parent 6fa7841 commit f15d719

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

cmd/ls.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,11 @@ func listAllSSMContainer() {
3737
if p, e := c.GetPortInfo(); e != nil {
3838
portStr = "none"
3939
} else {
40-
portStr = fmt.Sprintf("%s: %s->%s", p.Type, p.Public, p.Private)
40+
ip := "-"
41+
if len(c.DockerContainer.Ports) > 0 {
42+
ip = c.DockerContainer.Ports[0].IP
43+
}
44+
portStr = fmt.Sprintf("%s:%s->%s/%s", ip, p.Public, p.Private, p.Type)
4145
}
4246
tbl.AddRow(c.ContainerType, c.DockerContainer.ID[:24], c.Version, portStr, c.DockerContainer.State, c.Name)
4347
}

0 commit comments

Comments
 (0)