From d060edab23da94799db3155a34fb3244bc5548ef Mon Sep 17 00:00:00 2001 From: HynoR <20227709+HynoR@users.noreply.github.com> Date: Tue, 18 Nov 2025 12:18:43 +0800 Subject: [PATCH] refactor: Simplify endpoint handling in S3 client initialization --- agent/utils/cloud_storage/client/s3.go | 3 +-- core/utils/cloud_storage/client/s3.go | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/agent/utils/cloud_storage/client/s3.go b/agent/utils/cloud_storage/client/s3.go index b7b25cd81..79d2e168a 100644 --- a/agent/utils/cloud_storage/client/s3.go +++ b/agent/utils/cloud_storage/client/s3.go @@ -46,8 +46,7 @@ func NewS3Client(vars map[string]interface{}) (*s3Client, error) { client := s3.NewFromConfig(cfg, func(o *s3.Options) { o.UsePathStyle = mode == "path" if endpoint != "" { - base := normalizeEndpoint(endpoint) - o.BaseEndpoint = aws.String(base) + o.BaseEndpoint = aws.String(normalizeEndpoint(endpoint)) } }) diff --git a/core/utils/cloud_storage/client/s3.go b/core/utils/cloud_storage/client/s3.go index 93e233cbc..335484b11 100644 --- a/core/utils/cloud_storage/client/s3.go +++ b/core/utils/cloud_storage/client/s3.go @@ -44,7 +44,7 @@ func NewS3Client(vars map[string]interface{}) (*s3Client, error) { client := s3.NewFromConfig(cfg, func(o *s3.Options) { o.UsePathStyle = mode == "path" if endpoint != "" { - o.EndpointResolver = s3.EndpointResolverFromURL(normalizeEndpoint(endpoint)) + o.BaseEndpoint = aws.String(normalizeEndpoint(endpoint)) } }) return &s3Client{scType: scType, bucket: bucket, client: client}, nil