mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 11:50:44 +00:00
Merge pull request #78704 from dashpole/fix_windows_podresources
Disable kubelet local endpoints on windows
This commit is contained in:
commit
b3b1c7c1e1
@ -2213,7 +2213,12 @@ func (kl *Kubelet) ListenAndServeReadOnly(address net.IP, port uint, enableCAdvi
|
||||
|
||||
// ListenAndServePodResources runs the kubelet podresources grpc service
|
||||
func (kl *Kubelet) ListenAndServePodResources() {
|
||||
server.ListenAndServePodResources(util.LocalEndpoint(kl.getPodResourcesDir(), podresources.Socket), kl.podManager, kl.containerManager)
|
||||
socket, err := util.LocalEndpoint(kl.getPodResourcesDir(), podresources.Socket)
|
||||
if err != nil {
|
||||
klog.V(2).Infof("Failed to get local endpoint for PodResources endpoint: %v", err)
|
||||
return
|
||||
}
|
||||
server.ListenAndServePodResources(socket, kl.podManager, kl.containerManager)
|
||||
}
|
||||
|
||||
// Delete the eligible dead container instances in a pod. Depending on the configuration, the latest dead containers may be kept around.
|
||||
|
@ -128,10 +128,10 @@ func parseEndpoint(endpoint string) (string, string, error) {
|
||||
}
|
||||
|
||||
// LocalEndpoint returns the full path to a unix socket at the given endpoint
|
||||
func LocalEndpoint(path, file string) string {
|
||||
func LocalEndpoint(path, file string) (string, error) {
|
||||
u := url.URL{
|
||||
Scheme: unixProtocol,
|
||||
Path: path,
|
||||
}
|
||||
return filepath.Join(u.String(), file+".sock")
|
||||
return filepath.Join(u.String(), file+".sock"), nil
|
||||
}
|
||||
|
@ -44,8 +44,8 @@ func UnlockPath(fileHandles []uintptr) {
|
||||
}
|
||||
|
||||
// LocalEndpoint empty implementation
|
||||
func LocalEndpoint(path, file string) string {
|
||||
return ""
|
||||
func LocalEndpoint(path, file string) (string, error) {
|
||||
return "", fmt.Errorf("LocalEndpoints are unsupported in this build")
|
||||
}
|
||||
|
||||
// GetBootTime empty implementation
|
||||
|
@ -107,13 +107,9 @@ func parseEndpoint(endpoint string) (string, string, error) {
|
||||
}
|
||||
}
|
||||
|
||||
// LocalEndpoint returns the full path to a windows named pipe
|
||||
func LocalEndpoint(path, file string) string {
|
||||
u := url.URL{
|
||||
Scheme: npipeProtocol,
|
||||
Path: path,
|
||||
}
|
||||
return u.String() + "//./pipe/" + file
|
||||
// LocalEndpoint empty implementation
|
||||
func LocalEndpoint(path, file string) (string, error) {
|
||||
return "", fmt.Errorf("LocalEndpoints are unsupported in this build")
|
||||
}
|
||||
|
||||
var tickCount = syscall.NewLazyDLL("kernel32.dll").NewProc("GetTickCount64")
|
||||
|
@ -104,7 +104,10 @@ func getNodeSummary() (*stats.Summary, error) {
|
||||
}
|
||||
|
||||
func getNodeDevices() (*podresourcesapi.ListPodResourcesResponse, error) {
|
||||
endpoint := util.LocalEndpoint(defaultPodResourcesPath, podresources.Socket)
|
||||
endpoint, err := util.LocalEndpoint(defaultPodResourcesPath, podresources.Socket)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("Error getting local endpoint: %v", err)
|
||||
}
|
||||
client, conn, err := podresources.GetClient(endpoint, defaultPodResourcesTimeout, defaultPodResourcesMaxSize)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("Error getting grpc client: %v", err)
|
||||
|
Loading…
Reference in New Issue
Block a user