blob: ba39a4302dae5ece19adb2aa32e6dd2c933ef8dd [file] [log] [blame]
Lorenz Brun842536b2021-01-26 13:54:57 +01001Copyright 2020 The Monogon Project Authors.
2
3Licensed under the Apache License, Version 2.0 (the "License");
4you may not use this file except in compliance with the License.
5You may obtain a copy of the License at
6
7 http://www.apache.org/licenses/LICENSE-2.0
8
9Unless required by applicable law or agreed to in writing, software
10distributed under the License is distributed on an "AS IS" BASIS,
11WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12See the License for the specific language governing permissions and
13limitations under the License.
14
15
16From db9ab831cd17f9be540917a77bbb3e0551f4fb4f Mon Sep 17 00:00:00 2001
17From: Lorenz Brun <lorenz@brun.one>
18Date: Mon, 25 Jan 2021 15:08:20 +0100
19Subject: [PATCH] Make DeviceManager socket relative to RootDir
20
21---
22 pkg/kubelet/cm/container_manager_linux.go | 2 +-
23 pkg/kubelet/cm/devicemanager/manager.go | 4 ++--
24 2 files changed, 3 insertions(+), 3 deletions(-)
25
26diff --git a/pkg/kubelet/cm/container_manager_linux.go b/pkg/kubelet/cm/container_manager_linux.go
27index 57110ed7745..15cf010074e 100644
28--- a/pkg/kubelet/cm/container_manager_linux.go
29+++ b/pkg/kubelet/cm/container_manager_linux.go
30@@ -315,7 +315,7 @@ func NewContainerManager(mountUtil mount.Interface, cadvisorInterface cadvisor.I
31
32 klog.Infof("Creating device plugin manager: %t", devicePluginEnabled)
33 if devicePluginEnabled {
34- cm.deviceManager, err = devicemanager.NewManagerImpl(numaNodeInfo, cm.topologyManager)
35+ cm.deviceManager, err = devicemanager.NewManagerImpl(numaNodeInfo, cm.topologyManager, nodeConfig.KubeletRootDir)
36 cm.topologyManager.AddHintProvider(cm.deviceManager)
37 } else {
38 cm.deviceManager, err = devicemanager.NewManagerStub()
39diff --git a/pkg/kubelet/cm/devicemanager/manager.go b/pkg/kubelet/cm/devicemanager/manager.go
40index 5d1925f9458..bfff3c50fcc 100644
41--- a/pkg/kubelet/cm/devicemanager/manager.go
42+++ b/pkg/kubelet/cm/devicemanager/manager.go
43@@ -124,8 +124,8 @@ func (s *sourcesReadyStub) AddSource(source string) {}
44 func (s *sourcesReadyStub) AllReady() bool { return true }
45
46 // NewManagerImpl creates a new manager.
47-func NewManagerImpl(numaNodeInfo cputopology.NUMANodeInfo, topologyAffinityStore topologymanager.Store) (*ManagerImpl, error) {
48- return newManagerImpl(pluginapi.KubeletSocket, numaNodeInfo, topologyAffinityStore)
49+func NewManagerImpl(numaNodeInfo cputopology.NUMANodeInfo, topologyAffinityStore topologymanager.Store, kubeletRootDir string) (*ManagerImpl, error) {
50+ return newManagerImpl(filepath.Join(kubeletRootDir, "device-plugins/kubelet.sock"), numaNodeInfo, topologyAffinityStore)
51 }
52
53 func newManagerImpl(socketPath string, numaNodeInfo cputopology.NUMANodeInfo, topologyAffinityStore topologymanager.Store) (*ManagerImpl, error) {
54--
552.25.1
56