From ef662822c9e48ff7cfd9300590617e089c0a9498 Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Thu, 19 Oct 2023 23:40:55 +0200 Subject: jepsen: fix the list-objects call (?) --- script/jepsen.garage/src/jepsen/garage/s3api.clj | 27 ++++++++++++------------ 1 file changed, 14 insertions(+), 13 deletions(-) (limited to 'script/jepsen.garage/src/jepsen/garage/s3api.clj') diff --git a/script/jepsen.garage/src/jepsen/garage/s3api.clj b/script/jepsen.garage/src/jepsen/garage/s3api.clj index 977de7dc..4f292ac0 100644 --- a/script/jepsen.garage/src/jepsen/garage/s3api.clj +++ b/script/jepsen.garage/src/jepsen/garage/s3api.clj @@ -31,19 +31,20 @@ :input-stream bytes-stream :metadata {:content-length (count some-bytes)})))) +(defn list-inner [creds prefix ct accum] + (let [list-result (s3/list-objects-v2 creds + {:bucket-name (:bucket creds) + :prefix prefix + :continuation-token ct}) + new-object-summaries (:object-summaries list-result) + new-objects (map (fn [d] (:key d)) new-object-summaries) + objects (concat new-objects accum)] + (info (:endpoint creds) "ListObjectsV2 prefix(" prefix "), ct(" ct "): " new-objects) + (if (:truncated? list-result) + (list-inner creds prefix (:next-continuation-token list-result) objects) + objects))) (defn list "Helper for ListObjects -- just lists everything in the bucket" [creds prefix] - (defn list-inner [ct accum] - (let [list-result (s3/list-objects-v2 creds - {:bucket-name (:bucket creds) - :prefix prefix - :continuation-token ct}) - new-object-summaries (:object-summaries list-result) - new-objects (map (fn [d] (:key d)) new-object-summaries) - objects (concat new-objects accum)] - (info (:endpoint creds) "ListObjectsV2 prefix(" prefix "), ct(" ct "): " new-objects) - (if (:truncated? list-result) - (list-inner (:next-continuation-token list-result) objects) - objects))) - (list-inner nil [])) + (info "in s3/list creds:" creds ", prefix:" prefix) + (list-inner creds prefix nil [])) -- cgit v1.2.3