Skip to content

Commit

Permalink
feat: add IP binding display in ls
Browse files Browse the repository at this point in the history
  • Loading branch information
DesnLee committed Apr 29, 2024
1 parent 6fa7841 commit f15d719
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cmd/ls.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,11 @@ func listAllSSMContainer() {
if p, e := c.GetPortInfo(); e != nil {
portStr = "none"
} else {
portStr = fmt.Sprintf("%s: %s->%s", p.Type, p.Public, p.Private)
ip := "-"
if len(c.DockerContainer.Ports) > 0 {
ip = c.DockerContainer.Ports[0].IP
}
portStr = fmt.Sprintf("%s:%s->%s/%s", ip, p.Public, p.Private, p.Type)
}
tbl.AddRow(c.ContainerType, c.DockerContainer.ID[:24], c.Version, portStr, c.DockerContainer.State, c.Name)
}
Expand Down

0 comments on commit f15d719

Please sign in to comment.