mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-10-29 09:42:25 +00:00
Remove "expiration manager is nil on tokenstore" error log for dr secondary (#22137)
* add check for dr secondary case * add changelog
This commit is contained in:
3
changelog/22137.txt
Normal file
3
changelog/22137.txt
Normal file
@@ -0,0 +1,3 @@
|
||||
```release-note:bug
|
||||
core: Remove "expiration manager is nil on tokenstore" error log for unauth requests on DR secondary as they do not have expiration manager.
|
||||
```
|
||||
@@ -1692,8 +1692,14 @@ func (ts *TokenStore) lookupInternal(ctx context.Context, id string, salted, tai
|
||||
// If we are still restoring the expiration manager, we want to ensure the
|
||||
// token is not expired
|
||||
if ts.expiration == nil {
|
||||
return nil, errors.New("expiration manager is nil on tokenstore")
|
||||
switch ts.core.IsDRSecondary() {
|
||||
case true: // Bail if on DR secondary as expiration manager is nil
|
||||
return nil, nil
|
||||
default:
|
||||
return nil, errors.New("expiration manager is nil on tokenstore")
|
||||
}
|
||||
}
|
||||
|
||||
le, err := ts.expiration.FetchLeaseTimesByToken(ctx, entry)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to fetch lease times: %w", err)
|
||||
|
||||
Reference in New Issue
Block a user