mirror of
https://github.com/deuxfleurs-org/garage.git
synced 2026-08-11 06:46:53 +00:00
Merge branch 'main' into next-v2
This commit is contained in:
@@ -1114,6 +1114,7 @@ pub enum RepairType {
|
||||
BlockRc,
|
||||
Rebalance,
|
||||
Scrub(ScrubCommand),
|
||||
Aliases,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize, ToSchema)]
|
||||
|
||||
@@ -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?;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user