Fix bug where id not existing in multiplexing map causes panic (#16094)

* multiplexing: guard against connection panic

* changelog

* Update vault/plugin_catalog.go

Co-authored-by: Calvin Leung Huang <1883212+calvn@users.noreply.github.com>

Co-authored-by: Calvin Leung Huang <1883212+calvn@users.noreply.github.com>
This commit is contained in:
Jason O'Donnell
2022-06-22 14:29:25 -04:00
committed by GitHub
parent 03c1f3728f
commit 78e4016fd2
2 changed files with 7 additions and 1 deletions

3
changelog/16094.txt Normal file
View File

@@ -0,0 +1,3 @@
```release-note:bug
plugin/multiplexing: Fix panic when id doesn't exist in connection map
```

View File

@@ -157,7 +157,10 @@ func (c *PluginCatalog) cleanupExternalPlugin(name, id string) error {
return fmt.Errorf("plugin client not found")
}
pc := extPlugin.connections[id]
pc, ok := extPlugin.connections[id]
if !ok {
return fmt.Errorf("plugin connection not found")
}
delete(extPlugin.connections, id)
if !extPlugin.multiplexingSupport {