watchtower: add forceNext to NextSessionKeyIndex

This commit adds a forceNext boolean parameter to NextSessionKeyIndex.
Setting this param to true will force the index to cycle over 1000 key
indices before returning the new key.
This commit is contained in:
Elle Mouton committed 2023-03-31 12:04:57 +02:00
1 parent 204585c620
commit 24016c35c7
5 files changed
+81 -39

No files matched your search

+1 -1
View File
@@ -306,7 +306,7 @@ retryWithBackoff:
// with this specific tower. If one is already reserved, the
// existing index will be returned.
keyIndex, err := n.cfg.DB.NextSessionKeyIndex(
tower.ID, n.cfg.Policy.BlobType,
tower.ID, n.cfg.Policy.BlobType, false,
)
if err != nil {
n.log.Debugf("Unable to reserve session key index "+