mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-12 08:06:54 +00:00
get/put BucketVersionin done
This commit is contained in:
@@ -1,4 +1,7 @@
|
||||
use crate::error::{Error, Result};
|
||||
use crate::{
|
||||
error::{Error, Result},
|
||||
utils,
|
||||
};
|
||||
use rmp_serde::Serializer as rmpSerializer;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
@@ -69,7 +72,6 @@ impl Versioning {
|
||||
return Err(Error::new(VersioningErr::TooManyExcludedPrefixes));
|
||||
}
|
||||
}
|
||||
_ => return Err(Error::msg(format!("unsupported versioning status {}", self.status))),
|
||||
}
|
||||
|
||||
Ok(())
|
||||
@@ -97,7 +99,7 @@ impl Versioning {
|
||||
|
||||
for sprefix in self.excluded_prefixes.iter() {
|
||||
let full_prefix = format!("{}*", sprefix.prefix);
|
||||
if utils::wildcard::match_simple(full_prefix, prefix) {
|
||||
if utils::wildcard::match_simple(&full_prefix, prefix) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -124,7 +126,7 @@ impl Versioning {
|
||||
|
||||
for sprefix in self.excluded_prefixes.iter() {
|
||||
let full_prefix = format!("{}*", sprefix.prefix);
|
||||
if utils::wildcard::match_simple(full_prefix, prefix) {
|
||||
if utils::wildcard::match_simple(&full_prefix, prefix) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
use super::get_bucket_metadata_sys;
|
||||
use super::versioning::Versioning;
|
||||
use crate::disk::RUSTFS_META_BUCKET;
|
||||
use crate::error::Result;
|
||||
use tracing::warn;
|
||||
|
||||
pub struct BucketVersioningSys {}
|
||||
@@ -52,7 +53,7 @@ impl BucketVersioningSys {
|
||||
}
|
||||
|
||||
let bucket_meta_sys_lock = get_bucket_metadata_sys().await;
|
||||
let mut bucket_meta_sys = bucket_meta_sys_lock.write().await;
|
||||
let bucket_meta_sys = bucket_meta_sys_lock.write().await;
|
||||
|
||||
let (cfg, _) = bucket_meta_sys.get_versioning_config(bucket).await?;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user