From 1d4e1942d8722e104b670e49f9bb26621b984243 Mon Sep 17 00:00:00 2001 From: Penghao Cen Date: Thu, 26 Oct 2017 18:09:58 +0800 Subject: [PATCH] Add more comments for HandlerImpl struct --- pkg/kubelet/cm/deviceplugin/device_plugin_handler.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/kubelet/cm/deviceplugin/device_plugin_handler.go b/pkg/kubelet/cm/deviceplugin/device_plugin_handler.go index b95ec22610..4c9de6b3f8 100644 --- a/pkg/kubelet/cm/deviceplugin/device_plugin_handler.go +++ b/pkg/kubelet/cm/deviceplugin/device_plugin_handler.go @@ -61,12 +61,14 @@ type Handler interface { type HandlerImpl struct { // TODO: consider to change this to RWMutex. sync.Mutex + // devicePluginManager is an implementation of deviceplugin.Manager interface. devicePluginManager Manager // activePods is a method for listing active pods on the node // so the amount of pluginResources requested by existing pods // could be counted when updating allocated devices activePods ActivePodsFunc - // devicePluginManagerMonitorCallback is used for testing only. + // devicePluginManagerMonitorCallback is used for updating devices' states in one time call. + // e.g. a new device is advertised, two old devices are deleted and a running device fails. devicePluginManagerMonitorCallback MonitorCallback // allDevices contains all of registered resourceNames and their exported device IDs. allDevices map[string]sets.String