Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions dependency/vault_common.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,13 +138,13 @@ func leaseCheckWait(s *Secret) time.Duration {
}
}

// Handle if this is a secret with a rotation period. If this is a rotating secret,
// Handle if this is a secret with a ttl but without a lease. If this is a secret with a ttl,
// the rotating secret's TTL will be the duration to sleep before rendering the new secret.
var rotatingSecret bool
if _, ok := s.Data["rotation_period"]; ok && s.LeaseID == "" {
if s.LeaseID == "" {
if ttlInterface, ok := s.Data["ttl"]; ok {
if ttlData, err := ttlInterface.(json.Number).Int64(); err == nil {
log.Printf("[DEBUG] Found rotation_period and set lease duration to %d seconds", ttlData)
log.Printf("[DEBUG] Found ttl and set lease duration to %d seconds", ttlData)
// Add a second for cushion
base = int(ttlData) + 1
rotatingSecret = true
Expand Down