Skip to content

Commit

Permalink
Merge 0d3b86a into backport/csi-client-events-npe/closely-free-gnat
Browse files Browse the repository at this point in the history
  • Loading branch information
hc-github-team-nomad-core authored Dec 12, 2022
2 parents e35b034 + 0d3b86a commit 882e5d0
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
3 changes: 3 additions & 0 deletions .changelog/15518.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
csi: Fixed a bug where a crashing plugin could panic the Nomad client
```
12 changes: 7 additions & 5 deletions client/dynamicplugins/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -269,12 +269,14 @@ func (d *dynamicRegistry) DeregisterPlugin(ptype, name, allocID string) error {
}
}

broadcaster := d.broadcasterForPluginType(ptype)
event := &PluginUpdateEvent{
EventType: EventTypeDeregistered,
Info: info,
if info != nil {
broadcaster := d.broadcasterForPluginType(ptype)
event := &PluginUpdateEvent{
EventType: EventTypeDeregistered,
Info: info,
}
broadcaster.broadcast(event)
}
broadcaster.broadcast(event)

return d.sync()
}
Expand Down
2 changes: 1 addition & 1 deletion client/pluginmanager/csimanager/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ func (c *csiManager) resyncPluginsFromRegistry(ptype string) {

// handlePluginEvent syncs a single event against the plugin registry
func (c *csiManager) handlePluginEvent(event *dynamicplugins.PluginUpdateEvent) {
if event == nil {
if event == nil || event.Info == nil {
return
}
c.logger.Trace("dynamic plugin event",
Expand Down

0 comments on commit 882e5d0

Please sign in to comment.