mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-12-18 11:00:25 +00:00
cleanup: return error type in GetCryptoPassphrase()
Signed-off-by: Niels de Vos <ndevos@redhat.com>
This commit is contained in:
parent
c8c8176a37
commit
3dfe65d17c
@ -150,11 +150,11 @@ func GetCryptoPassphrase(ctx context.Context, volumeID string, kms EncryptionKMS
|
|||||||
volumeID)
|
volumeID)
|
||||||
passphrase, err = generateNewEncryptionPassphrase()
|
passphrase, err = generateNewEncryptionPassphrase()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", fmt.Errorf("failed to generate passphrase for %s: %s", volumeID, err)
|
return "", fmt.Errorf("failed to generate passphrase for %s: %w", volumeID, err)
|
||||||
}
|
}
|
||||||
err = kms.SavePassphrase(volumeID, passphrase)
|
err = kms.SavePassphrase(volumeID, passphrase)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", fmt.Errorf("failed to save the passphrase for %s: %s", volumeID, err)
|
return "", fmt.Errorf("failed to save the passphrase for %s: %w", volumeID, err)
|
||||||
}
|
}
|
||||||
return passphrase, nil
|
return passphrase, nil
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user