[#11] Add leading slash to FilePath attribute #16

Merged
alexvanin merged 1 commit from KurlesHS/rclone:fix/add_leading_slash into tcl/master 2025-02-21 14:40:48 +00:00
Member

When storing an object, a leading slash is added to the FilePath attribute. Also, now when searching for objects it is required that this attribute begin with the character /.

close #11

When storing an object, a leading slash is added to the `FilePath` attribute. Also, now when searching for objects it is required that this attribute begin with the character `/`. close #11
KurlesHS added 1 commit 2025-02-17 12:33:07 +00:00
[#11] Add leading slash to FilePath attr
Some checks failed
/ DCO (pull_request) Failing after 42s
/ Builds (pull_request) Successful in 2m9s
/ Lint (pull_request) Has been cancelled
/ Test (pull_request) Has been cancelled
e0a56e1d66
KurlesHS self-assigned this 2025-02-17 12:33:14 +00:00
KurlesHS force-pushed fix/add_leading_slash from e0a56e1d66 to 0616a569e2 2025-02-17 12:35:27 +00:00 Compare
requested reviews from storage-services-committers, storage-services-developers 2025-02-17 12:41:33 +00:00
dkirillov reviewed 2025-02-17 14:30:56 +00:00
@ -331,1 +333,4 @@
if objInfo.filePath == "" || objInfo.filePath[0] != '/' {
return nil, errMalformedObject
}
// Don't include a leading slash in the resulting object's file path.
Member

Why so?

Why so?
Author
Member

Here, we create an rclone object from a FrostFS object. The internal implementation of this backend assumes that the object.remote and fs.rootDirectory fields of the object will not have a leading slash. We ensure that a slash will be added to these fields later when storing, deleting, and searching for objects in FrostFS. This is handled by the findObjects, deleteByPrefix, and fillHeaders methods.

Here, we create an rclone object from a FrostFS object. The internal implementation of this backend assumes that the `object.remote` and `fs.rootDirectory` fields of the object will not have a leading slash. We ensure that a slash will be added to these fields later when storing, deleting, and searching for objects in FrostFS. This is handled by the `findObjects`, `deleteByPrefix`, and `fillHeaders` methods.
dkirillov marked this conversation as resolved
dkirillov approved these changes 2025-02-19 14:31:18 +00:00
dkirillov left a comment
Member

LGTM

LGTM
r.loginov approved these changes 2025-02-19 16:13:03 +00:00
alexvanin approved these changes 2025-02-21 14:40:24 +00:00
alexvanin merged commit 5557f6af23 into tcl/master 2025-02-21 14:40:48 +00:00
alexvanin deleted branch fix/add_leading_slash 2025-02-21 14:40:50 +00:00
Sign in to join this conversation.
No description provided.