agent: include ip in container port if not 0.0.0.0 or ::

This commit is contained in:
henrygd
2026-03-15 14:57:55 -04:00
parent 380d2b1091
commit 5bfe4f6970
3 changed files with 36 additions and 40 deletions

View File

@@ -368,6 +368,12 @@ func convertContainerPortsToString(ctr *container.ApiInfo) string {
if builder.Len() > 0 {
builder.WriteString(", ")
}
switch p.IP {
case "0.0.0.0", "::":
default:
builder.WriteString(p.IP)
builder.WriteByte(':')
}
builder.WriteString(strconv.Itoa(int(p.PublicPort)))
}
// clear ports slice so it doesn't get reused and blend into next response