mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-03 04:16:42 +00:00
rbd: skip comparing volumes in a group if new group is created
While calling CreateVolumeGroup RPC, if a new group is being created we can skip comparing volumes in a group because it is redundant. Signed-off-by: Nikhil-Ladha <nikhilladha1999@gmail.com>
This commit is contained in:
parent
a0074471ce
commit
2217e5cc35
@ -178,9 +178,8 @@ func (vs *VolumeGroupServer) CreateVolumeGroup(
|
|||||||
}
|
}
|
||||||
|
|
||||||
log.DebugLog(ctx, "existing volume group %q has been resolved: %+v", groupName, vg)
|
log.DebugLog(ctx, "existing volume group %q has been resolved: %+v", groupName, vg)
|
||||||
}
|
|
||||||
|
|
||||||
// TODO: check the number of volumes in the vg, it needs to be empty, or match len(volumes)
|
// verify that all the volumes are part of the existing volume group
|
||||||
matches, err := mgr.CompareVolumesInGroup(ctx, volumes, vg)
|
matches, err := mgr.CompareVolumesInGroup(ctx, volumes, vg)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, status.Errorf(
|
return nil, status.Errorf(
|
||||||
@ -195,6 +194,7 @@ func (vs *VolumeGroupServer) CreateVolumeGroup(
|
|||||||
"volume group %q does not match with requested volumes",
|
"volume group %q does not match with requested volumes",
|
||||||
groupName)
|
groupName)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
vols, err := vg.ListVolumes(ctx)
|
vols, err := vg.ListVolumes(ctx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user