vault: Ensure we always set a key InstallTime
This commit is contained in:
parent
ef2f71e17f
commit
1903518202
|
@ -58,6 +58,11 @@ func (k *Keyring) AddKey(key *Key) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
// Add a time if none
|
||||
if key.InstallTime.IsZero() {
|
||||
key.InstallTime = time.Now()
|
||||
}
|
||||
|
||||
// Install the new key
|
||||
k.keys[key.Term] = key
|
||||
|
||||
|
|
Loading…
Reference in a new issue