diff --git a/internal/rbd/rbd_util.go b/internal/rbd/rbd_util.go index 703809c95..e363e391c 100644 --- a/internal/rbd/rbd_util.go +++ b/internal/rbd/rbd_util.go @@ -468,6 +468,10 @@ func (ri *rbdImage) openIoctx() error { return nil } + if ri.conn == nil { + return fmt.Errorf("can not get IOContext of unconnected image %q", ri) + } + ioctx, err := ri.conn.GetIoctx(ri.Pool) if err != nil { // GetIoctx() can return util.ErrPoolNotFound