Merge branch 'main' into next-v2

This commit is contained in:
Alex Auvolat
2025-05-23 16:33:07 +02:00
30 changed files with 522 additions and 142 deletions
+1
View File
@@ -1114,6 +1114,7 @@ pub enum RepairType {
BlockRc,
Rebalance,
Scrub(ScrubCommand),
Aliases,
}
#[derive(Debug, Clone, Serialize, Deserialize, ToSchema)]
+3 -3
View File
@@ -159,7 +159,7 @@ impl RequestHandler for CreateBucketRequest {
let helper = garage.locked_helper().await;
if let Some(ga) = &self.global_alias {
if !is_valid_bucket_name(ga) {
if !is_valid_bucket_name(ga, garage.config.allow_punycode) {
return Err(Error::bad_request(format!(
"{}: {}",
ga, INVALID_BUCKET_NAME_MESSAGE
@@ -174,7 +174,7 @@ impl RequestHandler for CreateBucketRequest {
}
if let Some(la) = &self.local_alias {
if !is_valid_bucket_name(&la.alias) {
if !is_valid_bucket_name(&la.alias, garage.config.allow_punycode) {
return Err(Error::bad_request(format!(
"{}: {}",
la.alias, INVALID_BUCKET_NAME_MESSAGE
@@ -255,7 +255,7 @@ impl RequestHandler for DeleteBucketRequest {
for ((key_id, alias), _, active) in state.local_aliases.items().iter() {
if *active {
helper
.unset_local_bucket_alias(bucket.id, key_id, alias)
.purge_local_bucket_alias(bucket.id, key_id, alias)
.await?;
}
}
+4
View File
@@ -89,6 +89,10 @@ impl RequestHandler for LocalLaunchRepairOperationRequest {
garage.block_manager.clone(),
));
}
RepairType::Aliases => {
info!("Repairing bucket aliases (foreground)");
garage.locked_helper().await.repair_aliases().await?;
}
}
Ok(LocalLaunchRepairOperationResponse)
}