-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Object store clients: List() recursively #3784
Comments
Sounds like a nice extension to me (and something that we already use in Cortex, although not with Thanos bucket reader). Instead of hardcoding empty-delimiter, we could allow passing arbitrary delimiter, but support from various implementations may not be there.
I like this option: It would stay just |
Minio doesn't allow it. Reason why I proposed |
I think I would vote for this. The same method, just implementations has to be adjusted. |
Thank you for the amazing overview of all implementations. Happy to add recursion to APIs in such way |
Is your proposal related to a problem?
Cortex internally uses the Thanos objstore clients. We have an use case for which we need to list objects recursively, basically setting
delimiter=""
instead of the defaultdelimiter="/"
.Describe the solution you'd like
I'm proposing to extend
objstore.BucketReader
interface adding the following:Describe alternatives you've considered
Iter()
but would break signature add extra boilerplate to add to eachIter()
callIter()
, soIterWithOptions(ctx context.Context, dir string, f func(string) error, options ...IterOption) error
: could work too, no big preferenceAdditional context
Quick analysis of supported backends:
Recursive
and we're currently hardcodingRecursive: false
storage.Query
allows to customise theDelimiter
and we're currently hardcoding it to/
(setting it to empty string returns the whole tree under the provided prefix, which is what we want with recursive = true)ListBlobsFlatSegment()
instead ofListBlobsHierarchySegment()
ioutil.ReadDir()
tofilepath.Walk()
and recursively enter directories as soon as we find them (to keep lexicographically order guarantee)swift.ObjectsOpts{ Delimiter: 0 }
The text was updated successfully, but these errors were encountered: