Handle when pluginCatalog.Get returns (nil,nil) during cred backend creation (#17204)
This commit is contained in:
parent
c7f4d79684
commit
d8101f82ee
|
@ -0,0 +1,3 @@
|
|||
```release-note:bug
|
||||
core: Fix panic when the plugin catalog returns neither a plugin nor an error.
|
||||
```
|
|
@ -797,7 +797,8 @@ func (c *Core) setupCredentials(ctx context.Context) error {
|
|||
backend, err = c.newCredentialBackend(ctx, entry, sysView, view)
|
||||
if err != nil {
|
||||
c.logger.Error("failed to create credential entry", "path", entry.Path, "error", err)
|
||||
if plug, plugerr := c.pluginCatalog.Get(ctx, entry.Type, consts.PluginTypeCredential, ""); plugerr == nil && !plug.Builtin {
|
||||
plug, plugerr := c.pluginCatalog.Get(ctx, entry.Type, consts.PluginTypeCredential, "")
|
||||
if plugerr == nil && plug != nil && !plug.Builtin {
|
||||
// If we encounter an error instantiating the backend due to an error,
|
||||
// skip backend initialization but register the entry to the mount table
|
||||
// to preserve storage and path.
|
||||
|
|
Loading…
Reference in New Issue