From b01504649d8aa396685166395e50fbda6784600b Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Wed, 28 Jan 2026 09:37:54 -0800 Subject: [PATCH] s3tables: use path.Join for path construction and align namespace paths --- weed/s3api/s3tables/utils.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/weed/s3api/s3tables/utils.go b/weed/s3api/s3tables/utils.go index b796a1d09..b67af5863 100644 --- a/weed/s3api/s3tables/utils.go +++ b/weed/s3api/s3tables/utils.go @@ -2,6 +2,7 @@ package s3tables import ( "fmt" + "path" "path/filepath" "regexp" "time" @@ -35,17 +36,17 @@ func parseTableFromARN(arn string) (bucketName, namespace, tableName string, err // getTableBucketPath returns the filer path for a table bucket func getTableBucketPath(bucketName string) string { - return fmt.Sprintf("%s/%s", TablesPath, bucketName) + return path.Join(TablesPath, bucketName) } // getNamespacePath returns the filer path for a namespace func getNamespacePath(bucketName, namespace string) string { - return fmt.Sprintf("%s/%s/namespaces/%s", TablesPath, bucketName, namespace) + return path.Join(TablesPath, bucketName, namespace) } // getTablePath returns the filer path for a table func getTablePath(bucketName, namespace, tableName string) string { - return fmt.Sprintf("%s/%s/namespaces/%s/%s", TablesPath, bucketName, namespace, tableName) + return path.Join(TablesPath, bucketName, namespace, tableName) } // Metadata structures