Commit 15a24eb0 authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

Merge pull request #44316 from xiangpengzhao/print-node-addr

Automatic merge from submit-queue (batch tested with PRs 44440, 44038, 44302, 44316, 43876) Show node address type in kubectl describe node command **What this PR does / why we need it**: To make node addresses more clear when describing node. Before: ``` Addresses: 192.168.1.220,192.168.1.220,192.168.1.220 ``` After: ``` Addresses: LegacyHostIP: 192.168.1.220 InternalIP: 192.168.1.220 Hostname: 192.168.1.220 ``` **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 ```
parents 47ccb092 e1e1834e
......@@ -2070,9 +2070,10 @@ func describeNode(node *api.Node, nodeNonTerminatedPodsList *api.PodList, events
c.Message)
}
}
addresses := make([]string, 0, len(node.Status.Addresses))
w.Write(LEVEL_0, "Addresses:\n")
for _, address := range node.Status.Addresses {
addresses = append(addresses, address.Address)
w.Write(LEVEL_1, "%s:\t%s\n", address.Type, address.Address)
}
printResourceList := func(resourceList api.ResourceList) {
......@@ -2087,7 +2088,6 @@ func describeNode(node *api.Node, nodeNonTerminatedPodsList *api.PodList, events
}
}
w.Write(LEVEL_0, "Addresses:\t%s\n", strings.Join(addresses, ","))
if len(node.Status.Capacity) > 0 {
w.Write(LEVEL_0, "Capacity:\n")
printResourceList(node.Status.Capacity)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment