Skip to content

Commit

Permalink
Fix link physical address response to contain full path
Browse files Browse the repository at this point in the history
  • Loading branch information
guy-har committed Oct 10, 2023
1 parent c0d5d31 commit 32177e6
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
2 changes: 1 addition & 1 deletion esti/lakectl_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ func TestLakectlPreSignUpload(t *testing.T) {

filePath := "ro_1k.1"
vars["FILE_PATH"] = filePath
RunCmdAndVerifySuccessWithFile(t, Lakectl()+" fs upload -s files/ro_1k lakefs://"+repoName+"/"+mainBranch+"/"+filePath+" --pre-sign", false, "lakectl_fs_upload_pre_signed", vars)
RunCmdAndVerifySuccessWithFile(t, Lakectl()+" fs upload -s files/ro_1k lakefs://"+repoName+"/"+mainBranch+"/"+filePath+" --pre-sign", false, "lakectl_fs_upload", vars)

}

Expand Down
2 changes: 1 addition & 1 deletion pkg/api/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ func (c *Controller) LinkPhysicalAddress(w http.ResponseWriter, r *http.Request,
Mtime: entry.CreationDate.Unix(),
Path: entry.Path,
PathType: entryTypeObject,
PhysicalAddress: entry.PhysicalAddress,
PhysicalAddress: qk.Format(),
SizeBytes: swag.Int64(entry.Size),
}

Expand Down
5 changes: 1 addition & 4 deletions pkg/api/helpers/upload.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,10 +178,7 @@ func clientUploadPreSignHelper(ctx context.Context, client apigen.ClientWithResp
return nil, fmt.Errorf("link object to backing store: %w", err)
}
if linkResp.JSON200 != nil {
objStat := *linkResp.JSON200
// this is a workaround for the fact that the API does not return the full physical address
objStat.PhysicalAddress = preSignURL
return &objStat, nil
return linkResp.JSON200, nil
}
if linkResp.JSON409 != nil {
return nil, ErrConflict
Expand Down

0 comments on commit 32177e6

Please sign in to comment.