From 368172fd1b90e0e399bdff24372508a5ca58a775 Mon Sep 17 00:00:00 2001 From: zhucan Date: Thu, 9 Apr 2020 22:33:00 +0800 Subject: [PATCH] Add event for snapshotting in progress Signed-off-by: zhuc --- pkg/common-controller/snapshot_controller.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/common-controller/snapshot_controller.go b/pkg/common-controller/snapshot_controller.go index eaaf1235e..3ee3c6624 100644 --- a/pkg/common-controller/snapshot_controller.go +++ b/pkg/common-controller/snapshot_controller.go @@ -404,7 +404,6 @@ func (ctrl *csiSnapshotCommonController) syncUnreadySnapshot(snapshot *crdv1.Vol ctrl.updateSnapshotErrorStatusWithEvent(snapshot, v1.EventTypeWarning, "SnapshotStatusUpdateFailed", fmt.Sprintf("Snapshot status update failed, %v", err)) return err } - return nil } else { // snapshot.Spec.Source.VolumeSnapshotContentName == nil - dynamically creating snapshot klog.V(5).Infof("before getMatchSnapshotContent for snapshot %s", uniqueSnapshotName) @@ -457,6 +456,9 @@ func (ctrl *csiSnapshotCommonController) syncUnreadySnapshot(snapshot *crdv1.Vol ctrl.updateSnapshotErrorStatusWithEvent(snapshot, v1.EventTypeWarning, "SnapshotStatusUpdateFailed", fmt.Sprintf("Snapshot status update failed, %v", err)) return err } + + msg := fmt.Sprintf("waiting for a snapshot %s to be created by the CSI driver.", snapshot.Name) + ctrl.eventRecorder.Event(snapshot, v1.EventTypeNormal, "s/syncUnreadySnapshot/CreatingSnapshot", msg) } } return nil