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 9, 2020
1 parent ed6cd4a commit 368172f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/common-controller/snapshot_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 368172f

Please sign in to comment.