meteorgan commented on code in PR #5498:
URL: https://github.com/apache/opendal/pull/5498#discussion_r1900931654
##########
core/src/services/s3/lister.rs:
##########
@@ -231,26 +222,48 @@ impl oio::PageList for S3ObjectVersionsLister {
ctx.entries.push_back(de);
}
- for version_object in output.version {
- let mut path = build_rel_path(&self.core.root,
&version_object.key);
- if path.is_empty() {
- path = "/".to_owned();
+ if self.args.versions() {
+ for version_object in output.version {
+ let mut path = build_rel_path(&self.core.root,
&version_object.key);
+ if path.is_empty() {
+ path = "/".to_owned();
+ }
+
+ let mut meta = Metadata::new(EntryMode::from_path(&path));
+ meta.set_version(&version_object.version_id);
+ meta.set_is_current(version_object.is_latest);
+ meta.set_content_length(version_object.size);
+ meta.set_last_modified(parse_datetime_from_rfc3339(
+ version_object.last_modified.as_str(),
+ )?);
+ if let Some(etag) = version_object.etag {
+ meta.set_etag(&etag);
+ meta.set_content_md5(etag.trim_matches('"'));
+ }
+
+ let entry = oio::Entry::new(&path, meta);
+ ctx.entries.push_back(entry);
}
+ }
- let mut meta = Metadata::new(EntryMode::from_path(&path));
- meta.set_version(&version_object.version_id);
- meta.set_is_current(version_object.is_latest);
- meta.set_content_length(version_object.size);
- meta.set_last_modified(parse_datetime_from_rfc3339(
- version_object.last_modified.as_str(),
- )?);
- if let Some(etag) = version_object.etag {
- meta.set_etag(&etag);
- meta.set_content_md5(etag.trim_matches('"'));
+ if self.args.deleted() {
Review Comment:
Did I misunderstand something ? this implementation seems to differ from
the RFC description:
https://github.com/apache/opendal/blob/0146a12210c74aaa635ffba64ad8fec2ea8c3226/core/src/docs/rfcs/5495_list_with_deleted.md?plain=1#L35
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]