s3: fix TencentCOS CDN endpoint failing on bucket check

The Global Acceleration Endpoint (cos.accelerate.myqcloud.com) of
Tencent COS does not seem to support "CreateBucket" (maybe also other
bucket management operations). Since the acceleration functionality must
be enabled per-bucket in the Tencent Cloud console, the bucket will
always exist before this endpoint is used, so this check can be safely
skipped.

Now, "no_check_bucket = true" will be auto set when using this endpoint.

Why "NewFs()": on-the-fly remotes (connection string remotes), for
example, ":s3,provider=TencentCOS,...:..." will also be fixed.

Why no unit test: I can't find a good way to test "NewFs()" without
leveraging live endpoints. I think we can extract all existing mutations
for different providers (e.g., AWS, Fastly, and Rabata) from "NewFs()"
to a new function in the future.

Some Tencent docs about this CDN endpoint:
- English: Global Acceleration Endpoint | https://www.tencentcloud.com/pt/document/product/436/40700
- Chinese: 对象存储 全球加速概述_腾讯云 | https://cloud.tencent.com/document/product/436/38866

Assisted-By: OpenCode
This commit is contained in:
Mozi
2026-04-05 18:04:32 +00:00
committed by Nick Craig-Wood
parent d6c937f908
commit f86f0518c3
2 changed files with 13 additions and 0 deletions

View File

@@ -1691,6 +1691,10 @@ func NewFs(ctx context.Context, name, root string, m configmap.Mapper) (fs.Fs, e
if opt.Provider == "Rabata" {
f.features.Copy = nil
}
if opt.Provider == "TencentCOS" && strings.Contains(opt.Endpoint, "cos.accelerate.myqcloud.com") {
// Global Acceleration endpoint does not support bucket creation.
f.opt.NoCheckBucket = true
}
if opt.DirectoryMarkers {
f.features.CanHaveEmptyDirectories = true
}

View File

@@ -9005,6 +9005,15 @@ To configure access to Tencent COS, follow the steps below:
cos s3
```
#### Tencent COS Global Acceleration Endpoint
When using the Global Acceleration Endpoint (`cos.accelerate.myqcloud.com`),
rclone automatically sets `no_check_bucket = true` because this acceleration
endpoint does not support the `CreateBucket` call which is used for ensuring
a bucket's existence by rclone. Global Acceleration is a per-bucket feature,
so you should first create the bucket in one physical region, then enable it
in the Tencent Cloud console.
### Wasabi
[Wasabi](https://wasabi.com) is a cloud-based object storage service for a