rbd: add support to get volumegroupID

updated GetIDFromReplication to return
volumeGroupID if its present.

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
This commit is contained in:
Madhu Rajanna
2024-07-30 16:54:39 +02:00
committed by mergify[bot]
parent f7c78ae4fe
commit 3a8981a735
2 changed files with 65 additions and 0 deletions

View File

@ -128,6 +128,11 @@ func GetIDFromReplication(req interface{}) string {
if src != nil && src.GetVolume() != nil {
reqID = src.GetVolume().GetVolumeId()
}
if reqID == "" {
if src != nil && src.GetVolumegroup() != nil {
reqID = src.GetVolumegroup().GetVolumeGroupId()
}
}
if reqID == "" {
reqID = r.GetVolumeId() //nolint:nolintlint,staticcheck // req.VolumeId is deprecated
}