mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-16 23:29:21 +00:00
Display <none> when port is empty.
This commit is contained in:
parent
1780a527f6
commit
3e389566bf
@ -1072,9 +1072,13 @@ func describeContainerBasicInfo(container api.Container, status api.ContainerSta
|
||||
portString := describeContainerPorts(container.Ports)
|
||||
if strings.Contains(portString, ",") {
|
||||
w.Write(LEVEL_2, "Ports:\t%s\n", portString)
|
||||
} else {
|
||||
if len(portString) == 0 {
|
||||
w.Write(LEVEL_2, "Port:\t<none>\n")
|
||||
} else {
|
||||
w.Write(LEVEL_2, "Port:\t%s\n", portString)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func describeContainerPorts(cPorts []api.ContainerPort) string {
|
||||
|
Loading…
Reference in New Issue
Block a user