-
Notifications
You must be signed in to change notification settings - Fork 248
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
chore: Handle deletion when the underlying GCP resource does not exist #3826
base: master
Are you sure you want to change the base?
chore: Handle deletion when the underlying GCP resource does not exist #3826
Conversation
// and (false, nil) if the object was not found but should be presumed deleted. | ||
// In an error, the state is not fully determined - a delete might be in progress. | ||
// It returns (true, nil) if the object was deleted without error. | ||
// In an error (false, err), the state is not fully determined - a delete might be in progress. | ||
Delete(ctx context.Context, op *DeleteOperation) (deleted bool, err error) |
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.
I feel the returned deleted
might be unnecessary, but I'm open to discussion:
- it's not used anywhere for now:
if _, err := adapter.Delete(ctx, deleteOp); err != nil { - the situation
return (false, nil) if the object was not found but should be presumed deleted
, we could callFind
to determine the existence of the GCP obj, and avoid unnecessary Delete calls if obj does not exist. Also We don't have specific handling for the case of (false, nil); instead, we treat it the same as (true, nil).
This can be called without calling Find.
Unsure if there's a use case of it I haven't considered...
080046e
to
26bab12
Compare
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
duration: 232.507687ms | ||
status: 200 OK | ||
code: 200 | ||
duration: 245.142672ms |
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.
While idk why this changed, but I think the destroy version operation should return 200 instead of 404
Edit: This is handled in #3825, if version already got destroyed(404), we should not make the API call.
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
Change description
Fixes #3727
Tests you have done
make ready-pr
to ensure this PR is ready for review.