mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-25 20:53:33 +00:00
Merge pull request #6799 from xiang90/kerr
pkg/kubelet: fix error msg in GetHostIP
This commit is contained in:
commit
e265f2c58d
@ -1682,7 +1682,7 @@ func (kl *Kubelet) GetHostname() string {
|
||||
func (kl *Kubelet) GetHostIP() (net.IP, error) {
|
||||
node, err := kl.GetNode()
|
||||
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
|
||||
addressMap := make(map[api.NodeAddressType][]api.NodeAddress)
|
||||
@ -1698,7 +1698,7 @@ func (kl *Kubelet) GetHostIP() (net.IP, error) {
|
||||
if addresses, ok := addressMap[api.NodeExternalIP]; ok {
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user