@@ -210,27 +210,26 @@ func (cs *controllerServer) CreateSnapshot(_ context.Context, req *csi.CreateSna
210210}
211211
212212func (cs * controllerServer ) DeleteSnapshot (_ context.Context , req * csi.DeleteSnapshotRequest ) (* csi.DeleteSnapshotResponse , error ) {
213- snapshotID := req .GetSnapshotId ()
214- snapshot , err := getSnapshot (snapshotID )
213+ csiSnapshotID := req .GetSnapshotId ()
214+ sbSnapshot , err := getSnapshot (csiSnapshotID )
215215 if err != nil {
216- klog .Errorf ("failed to get spdk snapshot, snapshotID: %s err: %v" , snapshotID , err )
216+ klog .Errorf ("failed to get spdk snapshot, snapshotID: %s err: %v" , csiSnapshotID , err )
217217 return nil , err
218218 }
219- sbclient , err := util .NewsimplyBlockClient (snapshot .clusterID )
219+ sbclient , err := util .NewsimplyBlockClient (sbSnapshot .clusterID )
220220 if err != nil {
221221 klog .Errorf ("failed to create spdk client: %v" , err )
222222 return nil , status .Error (codes .Internal , err .Error ())
223223 }
224224
225- klog .Infof ("snapshotID=%s" , snapshotID )
226- unlock := cs .volumeLocks .Lock (snapshotID )
225+ unlock := cs .volumeLocks .Lock (csiSnapshotID )
227226 defer unlock ()
228227
229- klog .Infof ("Deleting Snapshot : snapshotID =%s" , snapshotID )
228+ klog .Infof ("Deleting Snapshot : csiSnapshotID =%s sbSnapshotID=%s " , csiSnapshotID , sbSnapshot . snapshotID )
230229
231- err = sbclient .DeleteSnapshot (snapshotID )
230+ err = sbclient .DeleteSnapshot (sbSnapshot . snapshotID )
232231 if err != nil {
233- klog .Errorf ("failed to delete snapshot, snapshotID: %s err: %v" , snapshotID , err )
232+ klog .Errorf ("failed to delete snapshot, snapshotID: %s err: %v" , csiSnapshotID , err )
234233 return nil , status .Error (codes .Internal , err .Error ())
235234 }
236235
0 commit comments