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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user