Commit Graph

10 Commits

Author SHA1 Message Date
Niels de Vos
9bea3feff1 rbd: add manager GetSnapshotByID and SnapshotResolver interface
A (CSI) VolumeGroupSnapshot object contains references to Snapshot IDs
(or CSI Snapshot handles). In order to work with a VolumeGroupSnapshot
struct, the Snapshot IDs need to be resolved into rbdSnapshot structs.

Signed-off-by: Niels de Vos <ndevos@ibm.com>
2024-11-06 11:37:44 +00:00
Niels de Vos
9808408340 rbd: pass CSI-drivername to volume group instead of journal instance
Each object is responsible for maintaining a connection to the journal.

By sharing a single journal, cleanup of objects becomes more complex as
the journal is used in deferred functions and only the last should
destroy the journal connection resources.

Signed-off-by: Niels de Vos <ndevos@ibm.com>
2024-11-06 11:37:44 +00:00
Praveen M
c7f41cf84b util: add GetCephFSRadosNamespace method
This commit adds `GetCephFSRadosNamespace` util method that returns
the `RadosNamespace` specified in ceph-csi-config ConfigMap under
cephFS.radosNamespace.

If not specified, the method returns the default RadosNamespace
i.e, csi.

Signed-off-by: Praveen M <m.praveen@ibm.com>
2024-10-21 14:11:27 +00:00
Niels de Vos
f2bc1c674b rbd: replace Manager.DeleteVolumeGroup() by VolumeGroup.Delete()
There is no need for the `Manager.DeleteVolumeGroup()` function as
`VolumeGroup.Delete()` should cover everything too.

By moving the `.Delete()` functionality of removing the group from the
journal to the shared `commonVolumeGroup` type, a volume group snaphot
can use it as well.

Signed-off-by: Niels de Vos <ndevos@ibm.com>
2024-09-26 13:59:21 +00:00
Madhu Rajanna
a243cf52d4 rbd: return more descriptive error
updated GetVolumeByID to return more
descriptive error so that caller no
need to add more details in
the error message.

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
2024-07-31 12:16:42 +00:00
Niels de Vos
74d434c3b7 rbd: check for valid UUID instead of name
It seems to be possible that the UUID was found, but the name is not
set. Checking on UUID makes the CreateVolumeGroup operation more
idempotent.

Signed-off-by: Niels de Vos <ndevos@ibm.com>
2024-07-25 12:18:24 +00:00
Niels de Vos
4acffb5548 rbd: make VolumeGroup Create/Delete/AddVolume/RemoveVolume idempotent
Add extra error checking to make sure trying to create an existing
volume group does not result in a failure. The same counts for deleting
a non-existing volume group, and adding/removing volumes to/from the
volume group.

Signed-off-by: Niels de Vos <ndevos@ibm.com>
2024-07-24 15:55:07 +00:00
Niels de Vos
382d70893d rbd: remove the VolumeGroup from the journal on DeleteVolumeGroup
Signed-off-by: Niels de Vos <ndevos@ibm.com>
2024-07-24 15:55:07 +00:00
Niels de Vos
a82ae15f1a rbd: use the Manager to handle CSI-Addons VolumeGroup requests
Signed-off-by: Niels de Vos <ndevos@ibm.com>
2024-07-24 15:55:07 +00:00
Niels de Vos
d248a1e200 rbd: add Manager interface for using Volumes and VolumeGroups
Signed-off-by: Niels de Vos <ndevos@ibm.com>
2024-07-11 11:17:13 +00:00