aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2022-01-10 12:38:33 +0100
committerAlex Auvolat <alex@adnab.me>2022-01-10 12:38:33 +0100
commit17ea28a4384aa04eee73fd92ed020e102f40f588 (patch)
tree955a64b921c5289f6e8e6a23d8cc9c7dc4eaa045 /src
parent8f39360f221e265f9c1fa4b2499573f0596fbf0c (diff)
downloadgarage-17ea28a4384aa04eee73fd92ed020e102f40f588.tar.gz
garage-17ea28a4384aa04eee73fd92ed020e102f40f588.zip
Fix trivial bug in CLI
Diffstat (limited to 'src')
-rw-r--r--src/garage/admin.rs8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/garage/admin.rs b/src/garage/admin.rs
index 9bfca94e..f315c4dc 100644
--- a/src/garage/admin.rs
+++ b/src/garage/admin.rs
@@ -531,7 +531,9 @@ impl AdminRpcHandler {
.bucket_helper()
.get_existing_matching_key(&query.key_pattern)
.await?;
- key.params_mut().unwrap().allow_create_bucket.update(true);
+ if query.create_bucket {
+ key.params_mut().unwrap().allow_create_bucket.update(true);
+ }
self.garage.key_table.insert(&key).await?;
self.key_info_result(key).await
}
@@ -542,7 +544,9 @@ impl AdminRpcHandler {
.bucket_helper()
.get_existing_matching_key(&query.key_pattern)
.await?;
- key.params_mut().unwrap().allow_create_bucket.update(false);
+ if query.create_bucket {
+ key.params_mut().unwrap().allow_create_bucket.update(false);
+ }
self.garage.key_table.insert(&key).await?;
self.key_info_result(key).await
}