mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-29 14:37:00 +00:00
Merge pull request #45572 from xiangpengzhao/fix-node-none
Automatic merge from submit-queue (batch tested with PRs 45685, 45572, 45624, 45723, 45733) Display <none> for "kubectl get pods -o wide" when node is empty. **What this PR does / why we need it**: If pods are pending due to no matched node to be scheduled, `Spec.NodeName` would be empty. In this case, "kubectl get pods -o wide" 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 ```
This commit is contained in:
commit
debced7449
@ -335,6 +335,9 @@ func printPodBase(pod *api.Pod, w io.Writer, options printers.PrintOptions) erro
|
||||
if podIP == "" {
|
||||
podIP = "<none>"
|
||||
}
|
||||
if nodeName == "" {
|
||||
nodeName = "<none>"
|
||||
}
|
||||
if _, err := fmt.Fprintf(w, "\t%s\t%s",
|
||||
podIP,
|
||||
nodeName,
|
||||
|
Loading…
Reference in New Issue
Block a user