-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
optimize code for restore exists resources #5293
Conversation
@sseago I think the logic modified now is equivalent to that before. Can you help me see what is wrong with my understanding. |
The biggest difference with this version is that in the "object doesn't exist" case, instead of adding restoreErr as a restore error, we add err -- so instead of the error returned by the create call, we're recording the "not found" error returned by the get call. |
2c78aff
to
a8d51b1
Compare
@sseago I submitted a new version. What do you think of this version? I always feel a little strange about the previous writing. |
395638a
to
c0a3440
Compare
Signed-off-by: cleverhu <[email protected]>
c0a3440
to
7de6f2a
Compare
@dsu-igeek @blackpiglet I'm sorry,I clicked the wrong button. I want @shubham-pampattiwar to help me review again instead of cancelling your review request. /PTAL |
Thank you for contributing to Velero!
Please add a summary of your change
Optimize the previous logic and handle errors uniformly. If the resource exists but cannot be found, the 'get' error will be returned; otherwise, the creation error will be returned.
Does your change fix a particular issue?
Fixes #5288
Please indicate you've done the following:
/kind changelog-not-required
as a comment on this pull request.site/content/docs/main
.