Lorenz Brun | 842536b | 2021-01-26 13:54:57 +0100 | [diff] [blame^] | 1 | Copyright 2020 The Monogon Project Authors. |
| 2 | |
| 3 | Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | you may not use this file except in compliance with the License. |
| 5 | You may obtain a copy of the License at |
| 6 | |
| 7 | http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | |
| 9 | Unless required by applicable law or agreed to in writing, software |
| 10 | distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | See the License for the specific language governing permissions and |
| 13 | limitations under the License. |
| 14 | |
| 15 | |
| 16 | From db9ab831cd17f9be540917a77bbb3e0551f4fb4f Mon Sep 17 00:00:00 2001 |
| 17 | From: Lorenz Brun <lorenz@brun.one> |
| 18 | Date: Mon, 25 Jan 2021 15:08:20 +0100 |
| 19 | Subject: [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 | |
| 26 | diff --git a/pkg/kubelet/cm/container_manager_linux.go b/pkg/kubelet/cm/container_manager_linux.go |
| 27 | index 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() |
| 39 | diff --git a/pkg/kubelet/cm/devicemanager/manager.go b/pkg/kubelet/cm/devicemanager/manager.go |
| 40 | index 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 | -- |
| 55 | 2.25.1 |
| 56 | |