Skip to content
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

Handle no path for delete objects in gateway #1708

Merged
merged 2 commits into from
Apr 4, 2021

Conversation

itaiad200
Copy link
Contributor

@itaiad200 itaiad200 commented Apr 4, 2021

closes #1706

@codecov-io
Copy link

Codecov Report

Merging #1708 (ee07c09) into master (6a01ee3) will decrease coverage by 0.00%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1708      +/-   ##
==========================================
- Coverage   41.64%   41.63%   -0.01%     
==========================================
  Files         168      168              
  Lines       13316    13318       +2     
==========================================
  Hits         5545     5545              
- Misses       7030     7032       +2     
  Partials      741      741              
Impacted Files Coverage Δ
pkg/gateway/operations/deleteobjects.go 0.00% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6a01ee3...ee07c09. Read the comment docs.

@itaiad200 itaiad200 requested review from johnnyaug, ozkatz and nopcoder and removed request for ozkatz April 4, 2021 11:27
@itaiad200 itaiad200 marked this pull request as ready for review April 4, 2021 11:27
@@ -63,6 +63,11 @@ func (controller *DeleteObjects) Handle(w http.ResponseWriter, req *http.Request
switch {
case errors.Is(err, catalog.ErrNotFound):
lg.Debug("tried to delete a non-existent object")
case errors.Is(err, catalog.ErrRequiredValue) && resolvedPath.Path == "":
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is risky: DeleteEntry will also return ErrRequiredValue if the repository or branch names are empty, and here you are possibly suppressing this error. Consider defining a new error type for an empty path.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alt, you can just check if the path we pass we parsed is empty and return success after successful get repo/branch.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nopcoder you mean get repo/branch here or in the cataloger?

If it's here, then it's a wasteful repeatable operation I would like to avoid.
If in the underlying cataloger then I'll need to rely or even modify behaviour for the gateway, which I think is suboptimal.

@itaiad200 itaiad200 requested a review from johnnyaug April 4, 2021 11:46
@itaiad200 itaiad200 merged commit e764bb8 into master Apr 4, 2021
@itaiad200 itaiad200 deleted the 1706-delete-objects-no-path branch April 4, 2021 12:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

lakeFS incompatibility issues with Spark (2.4.7) DeleteObjects request
4 participants