vault: Ensure we always set a key InstallTime

This commit is contained in:
Armon Dadgar 2015-05-27 12:12:16 -07:00
parent ef2f71e17f
commit 1903518202

View file

@ -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