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:
Kubernetes Submit Queue 2017-05-12 14:00:54 -07:00 committed by GitHub
commit debced7449

View File

@ -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,