pkg/kubelet: fix error msg in GetHostIP

This commit is contained in:
Xiang Li 2015-04-13 22:44:23 -07:00
parent d02139d2b4
commit 4a152290f4

View File

@ -1681,7 +1681,7 @@ func (kl *Kubelet) GetHostname() string {
func (kl *Kubelet) GetHostIP() (net.IP, error) { func (kl *Kubelet) GetHostIP() (net.IP, error) {
node, err := kl.GetNode() node, err := kl.GetNode()
if err != nil { if err != nil {
return nil, fmt.Errorf("Cannot get node: %v", err) return nil, fmt.Errorf("cannot get node: %v", err)
} }
addresses := node.Status.Addresses addresses := node.Status.Addresses
addressMap := make(map[api.NodeAddressType][]api.NodeAddress) addressMap := make(map[api.NodeAddressType][]api.NodeAddress)
@ -1697,7 +1697,7 @@ func (kl *Kubelet) GetHostIP() (net.IP, error) {
if addresses, ok := addressMap[api.NodeExternalIP]; ok { if addresses, ok := addressMap[api.NodeExternalIP]; ok {
return net.ParseIP(addresses[0].Address), nil return net.ParseIP(addresses[0].Address), nil
} }
return nil, fmt.Errorf("Host IP unknown; known addresses: %v", addresses) return nil, fmt.Errorf("host IP unknown; known addresses: %v", addresses)
} }
// GetPods returns all pods bound to the kubelet and their spec, and the mirror // GetPods returns all pods bound to the kubelet and their spec, and the mirror