New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add "SnapshotCreated" event for snapshot-controller #540
Conversation
Welcome @rexagod! |
Hi @rexagod. Thanks for your PR. I'm waiting for a kubernetes-csi member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
@@ -715,6 +715,9 @@ func (ctrl *csiSnapshotCommonController) createSnapshotContent(snapshot *crdv1.V | |||
klog.Errorf("failed to update content store %v", err) | |||
} | |||
|
|||
msg = fmt.Sprintf("Snapshot %s was successfully created by the CSI driver.", utils.SnapshotKey(snapshot)) | |||
ctrl.eventRecorder.Event(snapshot, v1.EventTypeNormal, "SnapshotCreated", msg) | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At this point, the VolumeSnapshotContent is just created. The CSI snapshotter sidecar will call the CSI driver to create a snapshot, but we don't know whether it is completed yet.
In updateSnapshotStatus (https://github.com/kubernetes-csi/external-snapshotter/blob/v4.1.1/pkg/common-controller/snapshot_controller.go#L1072), we know whether snapshot is created successfully.
Add a snapshot is created successfully event in this if block:
https://github.com/kubernetes-csi/external-snapshotter/blob/v4.1.1/pkg/common-controller/snapshot_controller.go#L1155
Add a snapshot is ready to use event in this if block:
https://github.com/kubernetes-csi/external-snapshotter/blob/v4.1.1/pkg/common-controller/snapshot_controller.go#L1162
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the detailed explaination, Xing!
Can you change this from "/kind bug" to "/kind feature"? |
/ok-to-test |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: rexagod, xing-yang The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Fixes: #522
What type of PR is this?
/kind feature
What this PR does / why we need it:
Adds
SnapshotCreated
andSnapshotReady
events to snapshot-controller.Which issue(s) this PR fixes:
Fixes #522
Special notes for your reviewer: This is my first PR here, and I hope this is the expected change, but if not, please let me know and I'll look into it right away. Thanks!
Does this PR introduce a user-facing change?: