aboutsummaryrefslogtreecommitdiff
path: root/script/jepsen.garage/src/jepsen/garage/grg.clj
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2023-04-19 15:27:26 +0200
committerAlex Auvolat <alex@adnab.me>2023-10-18 12:03:11 +0200
commit6eb26be548c08707b59473e6086f3f5eee89fe47 (patch)
treec1a62dca0702e95c7d47df35420c640619c21883 /script/jepsen.garage/src/jepsen/garage/grg.clj
parenteb86eaa6d2702ad5171c4fdfcbceb3dfba21833c (diff)
downloadgarage-6eb26be548c08707b59473e6086f3f5eee89fe47.tar.gz
garage-6eb26be548c08707b59473e6086f3f5eee89fe47.zip
Add garage set test (this one works :p)
Diffstat (limited to 'script/jepsen.garage/src/jepsen/garage/grg.clj')
-rw-r--r--script/jepsen.garage/src/jepsen/garage/grg.clj13
1 files changed, 11 insertions, 2 deletions
diff --git a/script/jepsen.garage/src/jepsen/garage/grg.clj b/script/jepsen.garage/src/jepsen/garage/grg.clj
index 2309d824..2e9bcc72 100644
--- a/script/jepsen.garage/src/jepsen/garage/grg.clj
+++ b/script/jepsen.garage/src/jepsen/garage/grg.clj
@@ -121,5 +121,14 @@
(defn s3-list
"Helper for ListObjects -- just lists everything in the bucket"
[creds]
- (s3/list-objects-v2 creds
- {:bucket-name (:bucket creds)}))
+ (defn list-inner [ct accum]
+ (let [list-result (s3/list-objects-v2 creds
+ {:bucket-name (:bucket creds)
+ :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)]
+ (if (:truncated? list-result)
+ (list-inner (:next-continuation-token list-result) objects)
+ objects)))
+ (list-inner nil []))