mirror of
				https://github.com/optim-enterprises-bv/kubernetes.git
				synced 2025-11-04 04:08:16 +00:00 
			
		
		
		
	Merge pull request #71889 from WanLinghao/function_clean_kubelet
Clean unused function in pkg/kubelet/kubelet.go
This commit is contained in:
		@@ -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
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user