mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-11-10 00:10:20 +00:00
rbd: correct return error for isCompatibleEncryption
isCompatibleEncryption is used to validate the requested volume and the existing volume and the destination volume name wont be generated yet and logging the destination volume prints the empty image name with pool name. Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
This commit is contained in:
parent
9fde4f7f18
commit
367eb9f748
@ -1562,10 +1562,10 @@ func (rv *rbdVolume) getOrigSnapName(snapID uint64) (string, error) {
|
||||
func (ri *rbdImage) isCompatibleEncryption(dst *rbdImage) error {
|
||||
switch {
|
||||
case ri.isEncrypted() && !dst.isEncrypted():
|
||||
return fmt.Errorf("encrypted volume %q does not match unencrypted volume %q", ri, dst)
|
||||
return fmt.Errorf("cannot create unencrypted volume from encrypted volume %q", ri)
|
||||
|
||||
case !ri.isEncrypted() && dst.isEncrypted():
|
||||
return fmt.Errorf("unencrypted volume %q does not match encrypted volume %q", ri, dst)
|
||||
return fmt.Errorf("cannot create encrypted volume from unencrypted volume %q", ri)
|
||||
}
|
||||
|
||||
return nil
|
||||
|
Loading…
Reference in New Issue
Block a user