mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-11-01 11:08:10 +00:00
Use a role cache to avoid separate locking paths (#6926)
* Use a role cache to avoid separate locking paths Due to the various locked/nonlocked paths we had a case where we weren't always checking for secondary status before trying to upgrade. This broadly simplifies things by using a cache to store the current role values (avoiding a lot of storage hits) and updating the cache on any write, delete, or invalidation.
This commit is contained in:
@@ -60,7 +60,7 @@ func TestBackend_CreateParseVerifyRoleTag(t *testing.T) {
|
||||
}
|
||||
|
||||
// read the created role entry
|
||||
roleEntry, err := b.lockedAWSRole(context.Background(), storage, "abcd-123")
|
||||
roleEntry, err := b.role(context.Background(), storage, "abcd-123")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
@@ -127,7 +127,7 @@ func TestBackend_CreateParseVerifyRoleTag(t *testing.T) {
|
||||
}
|
||||
|
||||
// get the entry of the newly created role entry
|
||||
roleEntry2, err := b.lockedAWSRole(context.Background(), storage, "ami-6789")
|
||||
roleEntry2, err := b.role(context.Background(), storage, "ami-6789")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user