Fix wrong err return value in plugin reload status command (#9348)
* Fix wrong return value (discovered when merging to ENT) * go.mod * go mod vendor * Add setup plugin reload hook * All reloads return something now
This commit is contained in:
parent
001ee861bd
commit
ad292bec73
|
@ -261,7 +261,7 @@ func (c *Sys) ReloadPlugin(i *ReloadPluginInput) (string, error) {
|
|||
// Get the reload id
|
||||
secret, parseErr := ParseSecret(resp.Body)
|
||||
if parseErr != nil {
|
||||
return "", err
|
||||
return "", parseErr
|
||||
}
|
||||
if _, ok := secret.Data["reload_id"]; ok {
|
||||
return secret.Data["reload_id"].(string), nil
|
||||
|
|
2
go.mod
2
go.mod
|
@ -84,7 +84,7 @@ require (
|
|||
github.com/hashicorp/vault-plugin-secrets-kv v0.5.5
|
||||
github.com/hashicorp/vault-plugin-secrets-mongodbatlas v0.1.2
|
||||
github.com/hashicorp/vault-plugin-secrets-openldap v0.1.4-0.20200618161832-cae59ebde561
|
||||
github.com/hashicorp/vault/api v1.0.5-0.20200630135746-8163ff047c9a
|
||||
github.com/hashicorp/vault/api v1.0.5-0.20200630153159-69a37f1037b5
|
||||
github.com/hashicorp/vault/sdk v0.1.14-0.20200527182800-ad90e0b39d2f
|
||||
github.com/influxdata/influxdb v0.0.0-20190411212539-d24b7ba8c4c4
|
||||
github.com/jcmturner/gokrb5/v8 v8.0.0
|
||||
|
|
|
@ -1932,6 +1932,9 @@ func (s standardUnsealStrategy) unseal(ctx context.Context, logger log.Logger, c
|
|||
if err := c.setupAuditedHeadersConfig(ctx); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := c.setupPluginReload(); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
c.auditBroker = NewAuditBroker(c.logger)
|
||||
}
|
||||
|
|
|
@ -467,9 +467,12 @@ func testSystemBackend_PluginReload(t *testing.T, reqData map[string]interface{}
|
|||
if err != nil {
|
||||
t.Fatalf("err: %v", err)
|
||||
}
|
||||
if resp != nil {
|
||||
if resp == nil {
|
||||
t.Fatalf("bad: %v", resp)
|
||||
}
|
||||
if resp.Data["reload_id"] == nil {
|
||||
t.Fatal("no reload_id in response")
|
||||
}
|
||||
|
||||
for i := 0; i < 2; i++ {
|
||||
// Ensure internal backed value is reset
|
||||
|
|
|
@ -195,3 +195,7 @@ func (c *Core) reloadBackendCommon(ctx context.Context, entry *MountEntry, isAut
|
|||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (c *Core) setupPluginReload() error {
|
||||
return handleSetupPluginReload(c)
|
||||
}
|
||||
|
|
|
@ -261,7 +261,7 @@ func (c *Sys) ReloadPlugin(i *ReloadPluginInput) (string, error) {
|
|||
// Get the reload id
|
||||
secret, parseErr := ParseSecret(resp.Body)
|
||||
if parseErr != nil {
|
||||
return "", err
|
||||
return "", parseErr
|
||||
}
|
||||
if _, ok := secret.Data["reload_id"]; ok {
|
||||
return secret.Data["reload_id"].(string), nil
|
||||
|
|
|
@ -495,7 +495,7 @@ github.com/hashicorp/vault-plugin-secrets-mongodbatlas
|
|||
# github.com/hashicorp/vault-plugin-secrets-openldap v0.1.4-0.20200618161832-cae59ebde561
|
||||
github.com/hashicorp/vault-plugin-secrets-openldap
|
||||
github.com/hashicorp/vault-plugin-secrets-openldap/client
|
||||
# github.com/hashicorp/vault/api v1.0.5-0.20200630135746-8163ff047c9a => ./api
|
||||
# github.com/hashicorp/vault/api v1.0.5-0.20200630153159-69a37f1037b5 => ./api
|
||||
github.com/hashicorp/vault/api
|
||||
# github.com/hashicorp/vault/sdk v0.1.14-0.20200527182800-ad90e0b39d2f => ./sdk
|
||||
github.com/hashicorp/vault/sdk/database/dbplugin
|
||||
|
|
Loading…
Reference in New Issue