1
0
mirror of https://github.com/docker/docs.git synced 2026-11-05 00:14:17 +03:00

Fill the KeyID member of ErrKeyNotFound in KeyDBStore

(Not necessary for the rest of this PR, just a related cleanup.)

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
This commit is contained in:
Miloslav Trmač
2016-01-11 18:59:15 +01:00
committed by Ying Li
parent 229d64e0e0
commit bcc97ed221

View File

@@ -117,7 +117,7 @@ func (s *KeyDBStore) GetKey(name string) (data.PrivateKey, string, error) {
// Retrieve the GORM private key from the database
dbPrivateKey := GormPrivateKey{}
if s.db.Where(&GormPrivateKey{KeyID: name}).First(&dbPrivateKey).RecordNotFound() {
return nil, "", trustmanager.ErrKeyNotFound{}
return nil, "", trustmanager.ErrKeyNotFound{KeyID: name}
}
// Get the passphrase to use for this key
@@ -165,7 +165,7 @@ func (s *KeyDBStore) RemoveKey(keyID string) error {
// Retrieve the GORM private key from the database
dbPrivateKey := GormPrivateKey{}
if s.db.Where(&GormPrivateKey{KeyID: keyID}).First(&dbPrivateKey).RecordNotFound() {
return trustmanager.ErrKeyNotFound{}
return trustmanager.ErrKeyNotFound{KeyID: keyID}
}
// Delete the key from the database
@@ -179,7 +179,7 @@ func (s *KeyDBStore) RotateKeyPassphrase(name, newPassphraseAlias string) error
// Retrieve the GORM private key from the database
dbPrivateKey := GormPrivateKey{}
if s.db.Where(&GormPrivateKey{KeyID: name}).First(&dbPrivateKey).RecordNotFound() {
return trustmanager.ErrKeyNotFound{}
return trustmanager.ErrKeyNotFound{KeyID: name}
}
// Get the current passphrase to use for this key