Skip to content

Commit 615adea

Browse files
authored
Merge pull request #289 from zhucan/bugfix-268
Add event for snapshotting in progress
2 parents d6be7e1 + 1ee21c1 commit 615adea

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

pkg/common-controller/snapshot_controller.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -682,6 +682,9 @@ func (ctrl *csiSnapshotCommonController) createSnapshotContent(snapshot *crdv1.V
682682
return nil, newControllerUpdateError(utils.SnapshotKey(snapshot), err.Error())
683683
}
684684

685+
msg := fmt.Sprintf("Waiting for a snapshot %s to be created by the CSI driver.", utils.SnapshotKey(snapshot))
686+
ctrl.eventRecorder.Event(snapshot, v1.EventTypeNormal, "CreatingSnapshot", msg)
687+
685688
// Update content in the cache store
686689
_, err = ctrl.storeContentUpdate(updateContent)
687690
if err != nil {

pkg/common-controller/snapshot_create_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ func TestCreateSnapshotSync(t *testing.T) {
206206
{"update", "volumesnapshots", errors.New("mock update error")},
207207
{"update", "volumesnapshots", errors.New("mock update error")},
208208
},
209-
expectedEvents: []string{"Warning SnapshotStatusUpdateFailed"},
209+
expectedEvents: []string{"Normal CreatingSnapshot"},
210210
expectSuccess: false,
211211
test: testSyncSnapshot,
212212
},

0 commit comments

Comments
 (0)