Correct snapshotContent error propagation#502
Merged
k8s-ci-robot merged 1 commit intokubernetes-csi:masterfrom Apr 22, 2021
Merged
Correct snapshotContent error propagation#502k8s-ci-robot merged 1 commit intokubernetes-csi:masterfrom
k8s-ci-robot merged 1 commit intokubernetes-csi:masterfrom
Conversation
xing-yang
reviewed
Apr 21, 2021
| 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 { |
Collaborator
There was a problem hiding this comment.
remoteAnnotationErr -> removeAnnotationErr
err != nil -> remoteAnnotationErr != nil
Contributor
Author
There was a problem hiding this comment.
Apologies. This has been fixed.
7e8ab7f to
c554274
Compare
Collaborator
|
/lgtm |
Contributor
|
[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 DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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?: