Skip to content

Commit

Permalink
Apply OSS part of ENT change re waitForReplicationState. (#10837)
Browse files Browse the repository at this point in the history
  • Loading branch information
ncabatoff authored Feb 4, 2021
1 parent 38a6f4c commit 2650dcd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
7 changes: 6 additions & 1 deletion vault/request_handling.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
Expand Down
5 changes: 4 additions & 1 deletion vault/request_handling_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2650dcd

Please sign in to comment.