mirror of https://github.com/ceph/go-ceph
rbd: export image name
Signed-off-by: Seena Fallah <seenafallah@gmail.com>
This commit is contained in:
parent
a46d9cbd62
commit
bae93ac4ab
|
@ -1407,6 +1407,10 @@
|
|||
"name": "Image.GetId",
|
||||
"comment": "GetId returns the internal image ID string.\n\nImplements:\n int rbd_get_id(rbd_image_t image, char *id, size_t id_len);\n"
|
||||
},
|
||||
{
|
||||
"name": "Image.GetName",
|
||||
"comment": "GetName returns the image name."
|
||||
},
|
||||
{
|
||||
"name": "Image.SetSnapshot",
|
||||
"comment": "SetSnapshot updates the rbd image (not the Snapshot) such that the snapshot\nis the source of readable data.\n\nImplements:\n int rbd_snap_set(rbd_image_t image, const char *snapname);\n"
|
||||
|
|
|
@ -951,6 +951,11 @@ func (image *Image) GetId() (string, error) {
|
|||
|
||||
}
|
||||
|
||||
// GetName returns the image name.
|
||||
func (image *Image) GetName() string {
|
||||
return image.name
|
||||
}
|
||||
|
||||
// SetSnapshot updates the rbd image (not the Snapshot) such that the snapshot
|
||||
// is the source of readable data.
|
||||
//
|
||||
|
|
|
@ -1641,6 +1641,14 @@ func TestGetId(t *testing.T) {
|
|||
conn.Shutdown()
|
||||
}
|
||||
|
||||
func TestGetName(t *testing.T) {
|
||||
image := Image{
|
||||
name: "testImg",
|
||||
}
|
||||
imgName := image.GetName()
|
||||
assert.Equal(t, image.name, imgName)
|
||||
}
|
||||
|
||||
func TestOpenImageById(t *testing.T) {
|
||||
conn := radosConnect(t)
|
||||
|
||||
|
|
Loading…
Reference in New Issue