Display <none> when port is empty.

This commit is contained in:
xiangpengzhao 2017-05-08 16:08:49 +08:00
parent 1780a527f6
commit 3e389566bf
No known key found for this signature in database
GPG Key ID: A9FD03A856417C5B

View File

@ -1073,7 +1073,11 @@ func describeContainerBasicInfo(container api.Container, status api.ContainerSta
if strings.Contains(portString, ",") {
w.Write(LEVEL_2, "Ports:\t%s\n", portString)
} else {
w.Write(LEVEL_2, "Port:\t%s\n", portString)
if len(portString) == 0 {
w.Write(LEVEL_2, "Port:\t<none>\n")
} else {
w.Write(LEVEL_2, "Port:\t%s\n", portString)
}
}
}