From faeb477880c88a9eacefdfe83a40e48a6028d883 Mon Sep 17 00:00:00 2001 From: weisd Date: Tue, 25 Jun 2024 17:35:31 +0800 Subject: [PATCH] run init --- Cargo.lock | 1 - ecstore/Cargo.toml | 1 - ecstore/src/store.rs | 2 +- rustfs/src/main.rs | 5 ++++- rustfs/src/storage/ecfs.rs | 4 ++-- 5 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 32be9a4a..05544368 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -312,7 +312,6 @@ dependencies = [ "netif", "reed-solomon-erasure", "regex", - "s3s", "serde", "thiserror", "tokio", diff --git a/ecstore/Cargo.toml b/ecstore/Cargo.toml index 1a5153a9..46075824 100644 --- a/ecstore/Cargo.toml +++ b/ecstore/Cargo.toml @@ -23,6 +23,5 @@ lazy_static = "1.5.0" regex = "1.10.5" netif = "0.1.6" async-trait = "0.1.80" -s3s = "0.10.0" tracing.workspace = true tracing-error = "0.2.0" diff --git a/ecstore/src/store.rs b/ecstore/src/store.rs index 230a6e84..c5d93ef0 100644 --- a/ecstore/src/store.rs +++ b/ecstore/src/store.rs @@ -16,7 +16,7 @@ pub struct ECStore { } impl ECStore { - pub fn new(endpoints: Vec, address: String) -> Result { + pub fn new(address: String, endpoints: Vec) -> Result { let layouts = DisksLayout::new(endpoints)?; let (pools, _) = create_server_endpoints(address, &layouts.pools, layouts.legacy)?; diff --git a/rustfs/src/main.rs b/rustfs/src/main.rs index 28ad2488..cfbac1fb 100644 --- a/rustfs/src/main.rs +++ b/rustfs/src/main.rs @@ -39,7 +39,10 @@ async fn run(opt: config::Opt) -> Result<()> { debug!("opt: {:?}", &opt); // Setup S3 service let service = { - let mut b = S3ServiceBuilder::new(storage::ecfs::EC::new(opt.volumes)?); + let mut b = S3ServiceBuilder::new(storage::ecfs::EC::new( + opt.address.clone(), + opt.volumes.clone(), + )?); // Enable authentication if let (Some(ak), Some(sk)) = (opt.access_key, opt.secret_key) { diff --git a/rustfs/src/storage/ecfs.rs b/rustfs/src/storage/ecfs.rs index ddd16cff..6a941c08 100644 --- a/rustfs/src/storage/ecfs.rs +++ b/rustfs/src/storage/ecfs.rs @@ -13,8 +13,8 @@ pub struct EC { } impl EC { - pub fn new(endpoints: Vec) -> Result { - let store = ECStore::new(endpoints)?; + pub fn new(address: String, endpoints: Vec) -> Result { + let store = ECStore::new(address, endpoints)?; Ok(EC { store }) } }