mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 19:56:01 +00:00
pkg/kubelet: fix error msg in GetHostIP
This commit is contained in:
parent
d02139d2b4
commit
4a152290f4
@ -1681,7 +1681,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)
|
||||
@ -1697,7 +1697,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