mirror of https://github.com/k3s-io/k3s
Merge pull request #45474 from xiangpengzhao/fix-port-none
Automatic merge from submit-queue (batch tested with PRs 41903, 45311, 45474, 45472, 45501) Display <none> when port is empty. **What this PR does / why we need it**: If container ports are not specified, `kubectl describe` displays `<none>` instead of empty. **Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes # **Special notes for your reviewer**: **Release note**: ```release-note NONE ```pull/6/head
commit
d092fc546b
|
@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue