mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-13 10:33:35 +00:00
rbd: add rbdVolume.open() to get access to an image
Signed-off-by: Niels de Vos <ndevos@redhat.com>
This commit is contained in:
committed by
mergify[bot]
parent
3482cb7091
commit
7a18e68a6e
@ -71,7 +71,13 @@ func (cc *ClusterConnection) GetIoctx(pool string) (*rados.IOContext, error) {
|
||||
|
||||
ioctx, err := cc.conn.OpenIOContext(pool)
|
||||
if err != nil {
|
||||
return nil, errors.Wrapf(err, "failed to open IOContext for pool %s", pool)
|
||||
// ErrNotFound indicates the Pool was not found
|
||||
if err == rados.ErrNotFound {
|
||||
err = ErrPoolNotFound{pool, err}
|
||||
} else {
|
||||
err = errors.Wrapf(err, "failed to open IOContext for pool %s", pool)
|
||||
}
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return ioctx, nil
|
||||
|
Reference in New Issue
Block a user