Fixes multiplexed plugin initialization after manual plugin reload (#17248)
* Fixes initialize not called after v5 plugin reload * use request context instead of core activeContext
This commit is contained in:
parent
5477fd86fa
commit
a6139cd5b2
|
@ -8,7 +8,6 @@ import (
|
|||
"sync"
|
||||
|
||||
log "github.com/hashicorp/go-hclog"
|
||||
|
||||
"github.com/hashicorp/go-multierror"
|
||||
"github.com/hashicorp/go-uuid"
|
||||
v5 "github.com/hashicorp/vault/builtin/plugin/v5"
|
||||
|
|
|
@ -213,6 +213,15 @@ func (c *Core) reloadBackendCommon(ctx context.Context, entry *MountEntry, isAut
|
|||
re.backend = backend
|
||||
|
||||
if backend != nil {
|
||||
// Initialize the backend after reload. This is a no-op for backends < v5 which
|
||||
// rely on lazy loading for initialization. v5 backends do not rely on lazy loading
|
||||
// for initialization unless the plugin process is killed. Reload of a v5 backend
|
||||
// results in a new plugin process, so we must initialize the backend here.
|
||||
err := backend.Initialize(ctx, &logical.InitializationRequest{Storage: view})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// Set paths as well
|
||||
paths := backend.SpecialPaths()
|
||||
if paths != nil {
|
||||
|
|
Loading…
Reference in New Issue