|
|
@@ -125,7 +125,7 @@ func newManagerImpl(socketPath string) (*ManagerImpl, error) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
manager.callback = manager.genericDeviceUpdateCallback
|
|
|
|
manager.callback = manager.genericDeviceUpdateCallback
|
|
|
|
|
|
|
|
|
|
|
|
// The following structs are populated with real implementations in manager.Start()
|
|
|
|
// The following structures are populated with real implementations in manager.Start()
|
|
|
|
// Before that, initializes them to perform no-op operations.
|
|
|
|
// Before that, initializes them to perform no-op operations.
|
|
|
|
manager.activePods = func() []*v1.Pod { return []*v1.Pod{} }
|
|
|
|
manager.activePods = func() []*v1.Pod { return []*v1.Pod{} }
|
|
|
|
manager.sourcesReady = &sourcesReadyStub{}
|
|
|
|
manager.sourcesReady = &sourcesReadyStub{}
|
|
|
@@ -189,8 +189,8 @@ func (m *ManagerImpl) checkpointFile() string {
|
|
|
|
return filepath.Join(m.socketdir, kubeletDeviceManagerCheckpoint)
|
|
|
|
return filepath.Join(m.socketdir, kubeletDeviceManagerCheckpoint)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Start starts the Device Plugin Manager amd start initialization of
|
|
|
|
// Start starts the Device Plugin Manager and start initialization of
|
|
|
|
// podDevices and allocatedDevices information from checkpoint-ed state and
|
|
|
|
// podDevices and allocatedDevices information from checkpointed state and
|
|
|
|
// starts device plugin registration service.
|
|
|
|
// starts device plugin registration service.
|
|
|
|
func (m *ManagerImpl) Start(activePods ActivePodsFunc, sourcesReady config.SourcesReady) error {
|
|
|
|
func (m *ManagerImpl) Start(activePods ActivePodsFunc, sourcesReady config.SourcesReady) error {
|
|
|
|
klog.V(2).Infof("Starting Device Plugin manager")
|
|
|
|
klog.V(2).Infof("Starting Device Plugin manager")
|
|
|
@@ -669,7 +669,7 @@ func (m *ManagerImpl) allocateContainerResources(pod *v1.Pod, container *v1.Cont
|
|
|
|
// and container2 both require X resource A and Y resource B. Both allocation
|
|
|
|
// and container2 both require X resource A and Y resource B. Both allocation
|
|
|
|
// requests may fail if we serve them in mixed order.
|
|
|
|
// requests may fail if we serve them in mixed order.
|
|
|
|
// TODO: may revisit this part later if we see inefficient resource allocation
|
|
|
|
// TODO: may revisit this part later if we see inefficient resource allocation
|
|
|
|
// in real use as the result of this. Should also consider to parallize device
|
|
|
|
// in real use as the result of this. Should also consider to parallelize device
|
|
|
|
// plugin Allocate grpc calls if it becomes common that a container may require
|
|
|
|
// plugin Allocate grpc calls if it becomes common that a container may require
|
|
|
|
// resources from multiple device plugins.
|
|
|
|
// resources from multiple device plugins.
|
|
|
|
m.mutex.Lock()
|
|
|
|
m.mutex.Lock()
|
|
|
|