-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Suppress not found error when applying remove operation #6645
Conversation
bundle/store.go
Outdated
@@ -959,6 +959,9 @@ func applyPatches(ctx context.Context, store storage.Store, txn storage.Transact | |||
|
|||
// apply the patch | |||
if err := store.Write(ctx, txn, op, path, pat.Value); err != nil { | |||
if op == storage.RemoveOp { | |||
return suppressNotFound(err) |
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.
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.
Oh yeah okk. I reverted the change and updated the doc then.
✅ Deploy Preview for openpolicyagent ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for openpolicyagent ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Signed-off-by: 0marq <45561584+0marq@users.noreply.github.com>
Update remove description to mention that target path must exist. Signed-off-by: 0marq <45561584+0marq@users.noreply.github.com>
Signed-off-by: 0marq <45561584+0marq@users.noreply.github.com>
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.
LGTM
Why the changes in this PR are needed?
Running remove operation on data that is not present should not return an error.
What are the changes in this PR?
In function
applyPatches
callsuppressNotFound
function on the output ofstore.Write
if operation is removeNotes to assist PR review:
Further comments: