When a parent image has been removed, it will linger in the trash until
all siblings are gone. The image is not accessible through it's name
anymore, only through its ID.
The ImageSpec that is returned by Image.GetParent() now contains the
Trash boolean and the ImageID to identify if the image is in the trash,
and use OpenImageById() to access the removed parent image.
Related-to: ceph/ceph-csi#4013
Signed-off-by: Niels de Vos <ndevos@ibm.com>
Luminous and mimic have not been supported for a few releases now.
There's no need to keep these build tags any more.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
GetParentInfo() currently requires the caller to specify the
string length for various attributes it returns. If the
specified string length is less than required, it can return
ERANGE error. Replacing it with a new function which avoids
this.
Signed-off-by: Mudit Agarwal <muagarwa@redhat.com>
The sparsify function can be used to make an image sparse by replacing
runs of zeros with holes. This change adds a wrapper for the basic
rbd_sparsify function and accompanying tests.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
In order to avoid external dependencies on implementation details,
this change replaces RBDError with the unexported rbdError. In case
some application really needs access to the integer value, it can use
the pattern
var errno interface{ Errno() int }
if errors.As(err, errno) { ... errno.Errno() ... }
Signed-off-by: Sven Anderson <sven@redhat.com>