mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-11-22 06:10:22 +00:00
util: add groupSnapshot details to getReqID
added CreateVolumeGroupSnapshotRequest and DeleteVolumeGroupSnapshotRequest to the getReqID so that we can get the ReqID for the logging. Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
This commit is contained in:
parent
12bd269d5b
commit
5ecfa0660f
@ -145,6 +145,13 @@ func getReqID(req interface{}) string {
|
||||
|
||||
case *csi.NodeExpandVolumeRequest:
|
||||
reqID = r.VolumeId
|
||||
|
||||
case *csi.CreateVolumeGroupSnapshotRequest:
|
||||
reqID = r.Name
|
||||
case *csi.DeleteVolumeGroupSnapshotRequest:
|
||||
reqID = r.GroupSnapshotId
|
||||
case *csi.GetVolumeGroupSnapshotRequest:
|
||||
reqID = r.GroupSnapshotId
|
||||
}
|
||||
|
||||
return reqID
|
||||
|
@ -65,6 +65,16 @@ func TestGetReqID(t *testing.T) {
|
||||
&csi.NodeExpandVolumeRequest{
|
||||
VolumeId: fakeID,
|
||||
},
|
||||
|
||||
&csi.CreateVolumeGroupSnapshotRequest{
|
||||
Name: fakeID,
|
||||
},
|
||||
&csi.DeleteVolumeGroupSnapshotRequest{
|
||||
GroupSnapshotId: fakeID,
|
||||
},
|
||||
&csi.GetVolumeGroupSnapshotRequest{
|
||||
GroupSnapshotId: fakeID,
|
||||
},
|
||||
}
|
||||
for _, r := range req {
|
||||
if got := getReqID(r); got != fakeID {
|
||||
|
Loading…
Reference in New Issue
Block a user