Skip to content

Commit

Permalink
Handle no path for delete objects in gateway
Browse files Browse the repository at this point in the history
  • Loading branch information
itaiad200 committed Apr 4, 2021
1 parent 6a01ee3 commit ee07c09
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/gateway/operations/deleteobjects.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 == "":
// issue #1706 - https://github.com/treeverse/lakeFS/issues/1706
// Spark trying to delete the path "main/", which we map to branch "main" with an empty path.
// Spark expects it to succeed (not deleting anything is a success), instead of returning an error.
lg.Debug("tried to delete with an empty branch")
case err != nil:
lg.WithError(err).Error("failed deleting object")
errs = append(errs, serde.DeleteError{
Expand Down

0 comments on commit ee07c09

Please sign in to comment.