mirror of
https://github.com/hashicorp/vault.git
synced 2026-05-05 12:26:34 +02:00
vault: Handle a negetive renew increment
This commit is contained in:
parent
f4aa96a566
commit
4c7d8ebf8d
@ -227,7 +227,7 @@ func (m *ExpirationManager) Renew(vaultID string, increment time.Duration) (*log
|
||||
}
|
||||
|
||||
// Set the default increment if none provided
|
||||
if increment == 0 {
|
||||
if increment <= 0 {
|
||||
increment = le.Lease.Duration
|
||||
}
|
||||
|
||||
@ -236,6 +236,7 @@ func (m *ExpirationManager) Renew(vaultID string, increment time.Duration) (*log
|
||||
increment = le.Lease.MaxIncrement
|
||||
}
|
||||
|
||||
// Restrict the increment to avoid exceeding maximum duration
|
||||
if increment > remain {
|
||||
increment = remain
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user