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
Correct snapshotContent error propagation #502
Correct snapshotContent error propagation #502
Conversation
@@ -300,8 +300,8 @@ func (ctrl *csiSnapshotSideCarController) createSnapshotWrapper(content *crdv1.V | |||
// storage system has responded with an error | |||
klog.Infof("createSnapshotWrapper: CreateSnapshot for content %s returned error: %v", content.Name, err) | |||
if isCSIFinalError(err) { | |||
if err := ctrl.removeAnnVolumeSnapshotBeingCreated(content); err != nil { | |||
return nil, fmt.Errorf("failed to remove VolumeSnapshotBeingCreated annotation from the content %s: %s", content.Name, err) | |||
if remoteAnnotationErr := ctrl.removeAnnVolumeSnapshotBeingCreated(content); err != nil { |
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.
remoteAnnotationErr -> removeAnnotationErr
err != nil -> remoteAnnotationErr != nil
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.
Apologies. This has been fixed.
7e8ab7f
to
c554274
Compare
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: huffmanca, 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 |
What type of PR is this?
/kind bug
What this PR does / why we need it:
Currently if we fail to create a snapshot in a CSIFinalError way, the error is overwritten when we attempt to remove the annotation on the content. This can result in the snapshot controller logging the error, but subsequent logs (and events) being nil:
We don't see any Events with the correct error logged. By changing the error we're able to get the events correctly created. There are still periodic issues with stale resources, but these are addressed by changing to Patch (or by performing a Get in
updateContentErrorStatusWithEvent
). These changes are being made in #480 , and therefore I didn't include them here.Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing change?: