Apply OSS part of ENT change re waitForReplicationState. (#10837)

This commit is contained in:
Nick Cabatoff 2021-02-04 09:10:35 -05:00 committed by GitHub
parent c62ce48b5b
commit 75c955b3c3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 2 deletions

View File

@ -443,11 +443,16 @@ func (c *Core) handleCancelableRequest(ctx context.Context, ns *namespace.Namesp
return logical.ErrorResponse("cannot write to a path ending in '/'"), nil
}
err = waitForReplicationState(ctx, c, req)
waitGroup, err := waitForReplicationState(ctx, c, req)
if err != nil {
return nil, err
}
// Decrement the wait group when our request is done
if waitGroup != nil {
defer waitGroup.Done()
}
if !hasNamespaces(c) && ns.Path != "" {
return nil, logical.CodedError(403, "namespaces feature not enabled")
}

View File

@ -4,12 +4,15 @@ package vault
import (
"context"
"sync"
"github.com/hashicorp/vault/helper/identity"
"github.com/hashicorp/vault/sdk/logical"
)
func waitForReplicationState(context.Context, *Core, *logical.Request) error { return nil }
func waitForReplicationState(context.Context, *Core, *logical.Request) (*sync.WaitGroup, error) {
return nil, nil
}
func checkNeedsCG(context.Context, *Core, *logical.Request, *logical.Auth, error, []string) (error, *logical.Response, *logical.Auth, error) {
return nil, nil, nil, nil