Add event for snapshotting in progress

Signed-off-by: zhuc <zhucan@xsky.com>
This commit is contained in:
zhucan
2020-04-22 11:52:59 +08:00
committed by zhuc
parent d6be7e120d
commit 1ee21c1de5
2 changed files with 4 additions and 1 deletions

View File

@@ -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 {

View File

@@ -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,
},