Skip to content

Commit f32313b

Browse files
committed
checkandUpdateContentStatusOperation should not call createSnapshotOperation
1 parent 0189c77 commit f32313b

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

pkg/sidecar-controller/snapshot_controller.go

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ func (ctrl *csiSnapshotSideCarController) checkandUpdateContentStatusOperation(c
291291
}
292292
return updatedContent, nil
293293
} else {
294-
return ctrl.createSnapshotOperation(content)
294+
return ctrl.createSnapshotWrapper(content)
295295
}
296296
}
297297

@@ -307,6 +307,13 @@ func (ctrl *csiSnapshotSideCarController) createSnapshotOperation(content *crdv1
307307
return content, nil
308308
}
309309

310+
return ctrl.createSnapshotWrapper(content)
311+
}
312+
313+
// This is a wrapper function for the snapshot creation process.
314+
func (ctrl *csiSnapshotSideCarController) createSnapshotWrapper(content *crdv1.VolumeSnapshotContent) (*crdv1.VolumeSnapshotContent, error) {
315+
klog.Infof("createSnapshotWrapper: Creating snapshot for content %s through the plugin ...", content.Name)
316+
310317
class, snapshotterCredentials, err := ctrl.getCSISnapshotInput(content)
311318
if err != nil {
312319
return nil, fmt.Errorf("failed to get input parameters to create snapshot for content %s: %q", content.Name, err)
@@ -329,7 +336,7 @@ func (ctrl *csiSnapshotSideCarController) createSnapshotOperation(content *crdv1
329336
// NOTE(xyang): handle create timeout
330337
// If it is a final error, remove annotation to indicate
331338
// storage system has responded with an error
332-
klog.Infof("createSnapshotOperation: CreateSnapshot for content %s returned error: %v", content.Name, err)
339+
klog.Infof("createSnapshotWrapper: CreateSnapshot for content %s returned error: %v", content.Name, err)
333340
if isFinalError(err) {
334341
err = ctrl.removeAnnVolumeSnapshotBeingCreated(content)
335342
if err != nil {

0 commit comments

Comments
 (0)