mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-14 21:53:52 +00:00
Clean unused function in pkg/kubelet/kublet.go
This commit is contained in:
@@ -1221,29 +1221,6 @@ type Kubelet struct {
|
|||||||
runtimeClassManager *runtimeclass.Manager
|
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:
|
// setupDataDirs creates:
|
||||||
// 1. the root directory
|
// 1. the root directory
|
||||||
// 2. the pods directory
|
// 2. the pods directory
|
||||||
|
Reference in New Issue
Block a user