Skip to content

Commit

Permalink
Add event for snapshotting in progress
Browse files Browse the repository at this point in the history
Signed-off-by: zhuc <[email protected]>
  • Loading branch information
zhucan authored and zhuc committed Apr 30, 2020
1 parent d6be7e1 commit 1ee21c1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions pkg/common-controller/snapshot_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -682,6 +682,9 @@ func (ctrl *csiSnapshotCommonController) createSnapshotContent(snapshot *crdv1.V
return nil, newControllerUpdateError(utils.SnapshotKey(snapshot), err.Error())
}

msg := fmt.Sprintf("Waiting for a snapshot %s to be created by the CSI driver.", utils.SnapshotKey(snapshot))
ctrl.eventRecorder.Event(snapshot, v1.EventTypeNormal, "CreatingSnapshot", msg)

// Update content in the cache store
_, err = ctrl.storeContentUpdate(updateContent)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion pkg/common-controller/snapshot_create_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ func TestCreateSnapshotSync(t *testing.T) {
{"update", "volumesnapshots", errors.New("mock update error")},
{"update", "volumesnapshots", errors.New("mock update error")},
},
expectedEvents: []string{"Warning SnapshotStatusUpdateFailed"},
expectedEvents: []string{"Normal CreatingSnapshot"},
expectSuccess: false,
test: testSyncSnapshot,
},
Expand Down

0 comments on commit 1ee21c1

Please sign in to comment.