From 8d7a47340c41bfc1ecd163ec90a52470cc010750 Mon Sep 17 00:00:00 2001 From: Nick Ethier Date: Fri, 25 Jan 2019 23:07:04 -0500 Subject: [PATCH] drivermanager: don't store nil reattach configs --- client/pluginmanager/drivermanager/manager.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/client/pluginmanager/drivermanager/manager.go b/client/pluginmanager/drivermanager/manager.go index ab3722c41..3b6ea6cc6 100644 --- a/client/pluginmanager/drivermanager/manager.go +++ b/client/pluginmanager/drivermanager/manager.go @@ -322,9 +322,12 @@ func (m *manager) storePluginReattachConfig(id loader.PluginID, c *plugin.Reatta m.reattachConfigLock.Lock() defer m.reattachConfigLock.Unlock() - // Store the new reattach config - m.reattachConfigs[id] = pstructs.ReattachConfigFromGoPlugin(c) - + if c == nil { + delete(m.reattachConfigs, id) + } else { + // Store the new reattach config + m.reattachConfigs[id] = pstructs.ReattachConfigFromGoPlugin(c) + } // Persist the state s := &state.PluginState{ ReattachConfigs: make(map[string]*pstructs.ReattachConfig, len(m.reattachConfigs)),