mirror of
https://github.com/rclone/rclone.git
synced 2026-05-12 18:38:00 -04:00
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:
@@ -1861,6 +1861,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
|
||||
}
|
||||
|
||||
@@ -9119,6 +9119,16 @@ 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.
|
||||
|
||||
### US3 {#us3}
|
||||
[US3](https://www.ucloud.cn/site/product/ufile.html) Object Storage is a service that provides cloud storage for unstructured files for internet applications.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user