mirror of https://github.com/k3s-io/k3s
Merge pull request #71889 from WanLinghao/function_clean_kubelet
Clean unused function in pkg/kubelet/kubelet.gopull/564/head
commit
89efdb4173
|
@ -1222,29 +1222,6 @@ type Kubelet struct {
|
|||
runtimeClassManager *runtimeclass.Manager
|
||||
}
|
||||
|
||||
func allGlobalUnicastIPs() ([]net.IP, error) {
|
||||
interfaces, err := net.Interfaces()
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("could not list network interfaces: %v", err)
|
||||
}
|
||||
var ips []net.IP
|
||||
for _, i := range interfaces {
|
||||
addresses, err := i.Addrs()
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("could not list the addresses for network interface %v: %v", i, err)
|
||||
}
|
||||
for _, address := range addresses {
|
||||
switch v := address.(type) {
|
||||
case *net.IPNet:
|
||||
if v.IP.IsGlobalUnicast() {
|
||||
ips = append(ips, v.IP)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return ips, nil
|
||||
}
|
||||
|
||||
// setupDataDirs creates:
|
||||
// 1. the root directory
|
||||
// 2. the pods directory
|
||||
|
|
Loading…
Reference in New Issue