diff --git a/clients/filesystem-fuse/src/filesystem.rs b/clients/filesystem-fuse/src/filesystem.rs index b20697aa00d..dcf35f8ebca 100644 --- a/clients/filesystem-fuse/src/filesystem.rs +++ b/clients/filesystem-fuse/src/filesystem.rs @@ -35,6 +35,8 @@ pub(crate) const ROOT_DIR_FILE_ID: u64 = 1; pub(crate) const ROOT_DIR_NAME: &str = ""; pub(crate) const ROOT_DIR_PATH: &str = "/"; pub(crate) const INITIAL_FILE_ID: u64 = 10000; + +// File system meta file is indicated the fuse filesystem is active. pub(crate) const FS_META_FILE_PATH: &str = "/.gvfs_meta"; pub(crate) const FS_META_FILE_NAME: &str = ".gvfs_meta"; pub(crate) const FS_META_FILE_ID: u64 = 10; diff --git a/clients/filesystem-fuse/src/s3_filesystem.rs b/clients/filesystem-fuse/src/s3_filesystem.rs index 98ebf278c84..18e8d04be3e 100644 --- a/clients/filesystem-fuse/src/s3_filesystem.rs +++ b/clients/filesystem-fuse/src/s3_filesystem.rs @@ -50,13 +50,24 @@ impl S3FileSystem { let bucket = extract_bucket(&fileset.storage_location)?; opendal_config.insert("bucket".to_string(), bucket); - let endpoint = catalog.properties.get("s3-endpoint"); - if endpoint.is_none() { - return Err(OpenDalError.to_error("s3-endpoint is not found in catalog")); - } - let endpoint = endpoint.unwrap(); - let region = extract_region(endpoint)?; - opendal_config.insert("region".to_string(), region); + let region = { + if let Some(region) = catalog.properties.get("region") { + Some(region.clone()) + } else if let Some(endpoint) = catalog.properties.get("s3-endpoint") { + extract_region(endpoint).ok() + } else { + None + } + }; + match region { + Some(region) => opendal_config.insert("region".to_string(), region), + None => { + return Err(InvalidConfig.to_error(format!( + "Cant not retrieve region in the Catalog {}", + catalog.name + ))); + } + }; let builder = S3::from_map(opendal_config);