diff --git a/pkg/microservice/aslan/core/common/service/helm.go b/pkg/microservice/aslan/core/common/service/helm.go index 8fca7dff83..3ea241f1cb 100644 --- a/pkg/microservice/aslan/core/common/service/helm.go +++ b/pkg/microservice/aslan/core/common/service/helm.go @@ -58,9 +58,9 @@ func DownloadService(base, serviceName string) error { filePath := fmt.Sprintf("%s.tar.gz", serviceName) tarFilePath := path.Join(base, filePath) objectKey := s3Storage.GetObjectPath(filePath) - forcedPathStyle := false - if s3Storage.Provider == setting.ProviderSourceSystemDefault { - forcedPathStyle = true + forcedPathStyle := true + if s3Storage.Provider == setting.ProviderSourceAli { + forcedPathStyle = false } client, err := s3tool.NewClient(s3Storage.Endpoint, s3Storage.Ak, s3Storage.Sk, s3Storage.Insecure, forcedPathStyle) if err != nil { diff --git a/pkg/microservice/aslan/core/common/service/it_report.go b/pkg/microservice/aslan/core/common/service/it_report.go index 31a2ea3535..bbab780eb5 100644 --- a/pkg/microservice/aslan/core/common/service/it_report.go +++ b/pkg/microservice/aslan/core/common/service/it_report.go @@ -75,9 +75,9 @@ func GetLocalTestSuite(pipelineName, serviceName, testType string, taskID int64, log.Errorf("GetLocalTestSuite GenerateTmpFile err:%v", err) } objectKey := s3Storage.GetObjectPath(fmt.Sprintf("%s/%d/%s/%s", pipelineName, taskID, "test", testJobName)) - forcedPathStyle := false - if s3Storage.Provider == setting.ProviderSourceSystemDefault { - forcedPathStyle = true + forcedPathStyle := true + if s3Storage.Provider == setting.ProviderSourceAli { + forcedPathStyle = false } client, err := s3tool.NewClient(s3Storage.Endpoint, s3Storage.Ak, s3Storage.Sk, s3Storage.Insecure, forcedPathStyle) if err != nil { diff --git a/pkg/microservice/aslan/core/common/service/scmnotify/scmnotify.go b/pkg/microservice/aslan/core/common/service/scmnotify/scmnotify.go index 08d4cb9e4a..48bc25d3dc 100644 --- a/pkg/microservice/aslan/core/common/service/scmnotify/scmnotify.go +++ b/pkg/microservice/aslan/core/common/service/scmnotify/scmnotify.go @@ -329,9 +329,9 @@ func downloadReport(taskInfo *task.Task, fileName, testName string, logger *zap. }() objectKey := store.GetObjectPath(fileName) - forcedPathStyle := false - if store.Provider == setting.ProviderSourceSystemDefault { - forcedPathStyle = true + forcedPathStyle := true + if store.Provider == setting.ProviderSourceAli { + forcedPathStyle = false } client, err := s3tool.NewClient(store.Endpoint, store.Ak, store.Sk, store.Insecure, forcedPathStyle) if err != nil { diff --git a/pkg/microservice/aslan/core/log/service/log.go b/pkg/microservice/aslan/core/log/service/log.go index 76ca205145..5b5ad337a7 100644 --- a/pkg/microservice/aslan/core/log/service/log.go +++ b/pkg/microservice/aslan/core/log/service/log.go @@ -88,9 +88,9 @@ func getContainerLogFromS3(pipelineName, filenamePrefix string, taskID int64, lo } else { storage.Subfolder = fmt.Sprintf("%s/%d/%s", pipelineName, taskID, "log") } - forcedPathStyle := false - if storage.Provider == setting.ProviderSourceSystemDefault { - forcedPathStyle = true + forcedPathStyle := true + if storage.Provider == setting.ProviderSourceAli { + forcedPathStyle = false } client, err := s3tool.NewClient(storage.Endpoint, storage.Ak, storage.Sk, storage.Insecure, forcedPathStyle) if err != nil { @@ -135,7 +135,7 @@ func GetCurrentContainerLogs(podName, containerName, envName, productName string } buf := new(bytes.Buffer) - err = containerlog.GetContainerLogs(envName,podName,containerName,false,tail,buf,clientSet) + err = containerlog.GetContainerLogs(envName, podName, containerName, false, tail, buf, clientSet) if err != nil { log.Errorf("containerlog.GetContainerLogs error: %v", err) return "", err diff --git a/pkg/microservice/aslan/core/service/service/helm.go b/pkg/microservice/aslan/core/service/service/helm.go index 33f529980d..8cb7a0c9be 100644 --- a/pkg/microservice/aslan/core/service/service/helm.go +++ b/pkg/microservice/aslan/core/service/service/helm.go @@ -581,9 +581,9 @@ func uploadService(base, serviceName, filePath string) error { log.Errorf("获取默认的s3配置失败 err:%v", err) return err } - forcedPathStyle := false - if s3Storage.Provider == setting.ProviderSourceSystemDefault { - forcedPathStyle = true + forcedPathStyle := true + if s3Storage.Provider == setting.ProviderSourceAli { + forcedPathStyle = false } client, err := s3tool.NewClient(s3Storage.Endpoint, s3Storage.Ak, s3Storage.Sk, s3Storage.Insecure, forcedPathStyle) if err != nil { diff --git a/pkg/microservice/aslan/core/service/service/service.go b/pkg/microservice/aslan/core/service/service/service.go index 52c32d494b..c20d41db69 100644 --- a/pkg/microservice/aslan/core/service/service/service.go +++ b/pkg/microservice/aslan/core/service/service/service.go @@ -568,9 +568,9 @@ func DeleteServiceTemplate(serviceName, serviceType, productName, isEnvTemplate, } else { s3Storage.Subfolder = fmt.Sprintf("%s/%s", subFolderName, "service") } - forcedPathStyle := false - if s3Storage.Provider == setting.ProviderSourceSystemDefault { - forcedPathStyle = true + forcedPathStyle := true + if s3Storage.Provider == setting.ProviderSourceAli { + forcedPathStyle = false } client, err := s3tool.NewClient(s3Storage.Endpoint, s3Storage.Ak, s3Storage.Sk, s3Storage.Insecure, forcedPathStyle) if err == nil { diff --git a/pkg/microservice/aslan/core/system/service/capacity.go b/pkg/microservice/aslan/core/system/service/capacity.go index fe67820445..fba668bfc0 100644 --- a/pkg/microservice/aslan/core/system/service/capacity.go +++ b/pkg/microservice/aslan/core/system/service/capacity.go @@ -329,9 +329,9 @@ func cleanStaleTasks(tasks []*task.Task, s3Server *s3.S3, dryRun bool) []string ids[i] = task.ID.Hex() paths[i] = fmt.Sprintf("%s/%d/", task.PipelineName, task.TaskID) } - forcedPathStyle := false - if s3Server.Provider == setting.ProviderSourceSystemDefault { - forcedPathStyle = true + forcedPathStyle := true + if s3Server.Provider == setting.ProviderSourceAli { + forcedPathStyle = false } s3client, err := s3tool.NewClient(s3Server.Endpoint, s3Server.Ak, s3Server.Sk, s3Server.Insecure, forcedPathStyle) if err == nil { diff --git a/pkg/microservice/aslan/core/system/service/s3.go b/pkg/microservice/aslan/core/system/service/s3.go index f44b191700..89f26377b4 100644 --- a/pkg/microservice/aslan/core/system/service/s3.go +++ b/pkg/microservice/aslan/core/system/service/s3.go @@ -29,9 +29,9 @@ import ( func UpdateS3Storage(updateBy, id string, storage *commonmodels.S3Storage, logger *zap.SugaredLogger) error { s3Storage := &s3.S3{S3Storage: storage} - forcedPathStyle := false - if s3Storage.Provider == setting.ProviderSourceSystemDefault { - forcedPathStyle = true + forcedPathStyle := true + if s3Storage.Provider == setting.ProviderSourceAli { + forcedPathStyle = false } client, err := s3tool.NewClient(s3Storage.Endpoint, s3Storage.Ak, s3Storage.Sk, s3Storage.Insecure, forcedPathStyle) if err != nil { @@ -49,9 +49,9 @@ func UpdateS3Storage(updateBy, id string, storage *commonmodels.S3Storage, logge func CreateS3Storage(updateBy string, storage *commonmodels.S3Storage, logger *zap.SugaredLogger) error { s3Storage := &s3.S3{S3Storage: storage} - forcedPathStyle := false - if s3Storage.Provider == setting.ProviderSourceSystemDefault { - forcedPathStyle = true + forcedPathStyle := true + if s3Storage.Provider == setting.ProviderSourceAli { + forcedPathStyle = false } client, err := s3tool.NewClient(s3Storage.Endpoint, s3Storage.Ak, s3Storage.Sk, s3Storage.Insecure, forcedPathStyle) if err != nil { diff --git a/pkg/microservice/aslan/core/workflow/service/workflow/nsq_handlers.go b/pkg/microservice/aslan/core/workflow/service/workflow/nsq_handlers.go index dbd1c30c26..03b5b0a7f2 100644 --- a/pkg/microservice/aslan/core/workflow/service/workflow/nsq_handlers.go +++ b/pkg/microservice/aslan/core/workflow/service/workflow/nsq_handlers.go @@ -440,9 +440,9 @@ func (h *TaskAckHandler) uploadTaskData(pt *task.Task) error { testJobName := strings.Replace(strings.ToLower(fmt.Sprintf("%s-%s-%d-%s-%s", config.WorkflowType, pt.PipelineName, pt.TaskID, config.TaskTestingV2, testInfo.TestModuleName)), "_", "-", -1) fileSrc := fmt.Sprintf("%s/%d/%s/%s", pt.PipelineName, pt.TaskID, "test", testJobName) - forcedPathStyle := false - if storage.Provider == setting.ProviderSourceSystemDefault { - forcedPathStyle = true + forcedPathStyle := true + if storage.Provider == setting.ProviderSourceAli { + forcedPathStyle = false } client, err := s3tool.NewClient(storage.Endpoint, storage.Ak, storage.Sk, storage.Insecure, forcedPathStyle) objectKey := storage.GetObjectPath(fileSrc) @@ -614,9 +614,9 @@ func (h *TaskAckHandler) uploadTaskData(pt *task.Task) error { testJobName := strings.Replace(strings.ToLower(fmt.Sprintf("%s-%s-%d-%s-%s", config.TestType, pipelineName, pt.TaskID, config.TaskTestingV2, testInfo.TestModuleName)), "_", "-", -1) fileSrc := fmt.Sprintf("%s/%d/%s/%s", pipelineName, pt.TaskID, "test", testJobName) - forcedPathStyle := false - if storage.Provider == setting.ProviderSourceSystemDefault { - forcedPathStyle = true + forcedPathStyle := true + if storage.Provider == setting.ProviderSourceAli { + forcedPathStyle = false } client, err := s3tool.NewClient(storage.Endpoint, storage.Ak, storage.Sk, storage.Insecure, forcedPathStyle) objectKey := storage.GetObjectPath(fileSrc) diff --git a/pkg/microservice/aslan/core/workflow/service/workflow/pipeline_task.go b/pkg/microservice/aslan/core/workflow/service/workflow/pipeline_task.go index c80bb8a62d..f7ade63ea0 100644 --- a/pkg/microservice/aslan/core/workflow/service/workflow/pipeline_task.go +++ b/pkg/microservice/aslan/core/workflow/service/workflow/pipeline_task.go @@ -903,9 +903,9 @@ func GePackageFileContent(pipelineName string, taskID int64, log *zap.SugaredLog defer func() { _ = os.Remove(tmpfile.Name()) }() - forcedPathStyle := false - if storage.Provider == setting.ProviderSourceSystemDefault { - forcedPathStyle = true + forcedPathStyle := true + if storage.Provider == setting.ProviderSourceAli { + forcedPathStyle = false } client, err := s3tool.NewClient(storage.Endpoint, storage.Ak, storage.Sk, storage.Insecure, forcedPathStyle) if err != nil { @@ -927,9 +927,9 @@ func GetArtifactFileContent(pipelineName string, taskID int64, log *zap.SugaredL if _, err := os.Stat(sourcePath); os.IsNotExist(err) { _ = os.MkdirAll(sourcePath, 0777) } - forcedPathStyle := false - if s3Storage.Provider == setting.ProviderSourceSystemDefault { - forcedPathStyle = true + forcedPathStyle := true + if s3Storage.Provider == setting.ProviderSourceAli { + forcedPathStyle = false } client, err := s3tool.NewClient(s3Storage.Endpoint, s3Storage.Ak, s3Storage.Sk, s3Storage.Insecure, forcedPathStyle) if err != nil { @@ -986,9 +986,9 @@ func GetTestArtifactInfo(pipelineName, dir string, taskID int64, log *zap.Sugare } else { storage.Subfolder = fmt.Sprintf("%s/%d/%s", pipelineName, taskID, "artifact") } - forcedPathStyle := false - if storage.Provider == setting.ProviderSourceSystemDefault { - forcedPathStyle = true + forcedPathStyle := true + if storage.Provider == setting.ProviderSourceAli { + forcedPathStyle = false } client, err := s3tool.NewClient(storage.Endpoint, storage.Ak, storage.Sk, storage.Insecure, forcedPathStyle) if err != nil { diff --git a/pkg/microservice/aslan/core/workflow/testing/service/it_report.go b/pkg/microservice/aslan/core/workflow/testing/service/it_report.go index 0257469ae3..c34210ae4e 100644 --- a/pkg/microservice/aslan/core/workflow/testing/service/it_report.go +++ b/pkg/microservice/aslan/core/workflow/testing/service/it_report.go @@ -78,9 +78,9 @@ func GetTestLocalTestSuite(serviceName string, log *zap.SugaredLogger) (*commonm if err != nil { log.Errorf("GetTestLocalTestSuite GenerateTmpFile err:%v", err) } - forcedPathStyle := false - if storage.Provider == setting.ProviderSourceSystemDefault { - forcedPathStyle = true + forcedPathStyle := true + if storage.Provider == setting.ProviderSourceAli { + forcedPathStyle = false } client, err := s3tool.NewClient(storage.Endpoint, storage.Ak, storage.Sk, storage.Insecure, forcedPathStyle) if err != nil { diff --git a/pkg/microservice/aslan/core/workflow/testing/service/testing.go b/pkg/microservice/aslan/core/workflow/testing/service/testing.go index ffa4148f27..0ea62ff578 100644 --- a/pkg/microservice/aslan/core/workflow/testing/service/testing.go +++ b/pkg/microservice/aslan/core/workflow/testing/service/testing.go @@ -359,9 +359,9 @@ func GetHTMLTestReport(pipelineName, pipelineType, taskIDStr, testName string, l defer func() { _ = os.Remove(tmpFilename) }() - forcedPathStyle := false - if store.Provider == setting.ProviderSourceSystemDefault { - forcedPathStyle = true + forcedPathStyle := true + if store.Provider == setting.ProviderSourceAli { + forcedPathStyle = false } client, err := s3tool.NewClient(store.Endpoint, store.Ak, store.Sk, store.Insecure, forcedPathStyle) if err != nil { diff --git a/pkg/microservice/aslan/core/workflow/testing/service/workspace.go b/pkg/microservice/aslan/core/workflow/testing/service/workspace.go index db7a581863..7f7916129f 100644 --- a/pkg/microservice/aslan/core/workflow/testing/service/workspace.go +++ b/pkg/microservice/aslan/core/workflow/testing/service/workspace.go @@ -40,9 +40,9 @@ func GetTestArtifactInfo(pipelineName, dir string, taskID int64, log *zap.Sugare } else { storage.Subfolder = fmt.Sprintf("%s/%d/%s", pipelineName, taskID, "artifact") } - forcedPathStyle := false - if storage.Provider == setting.ProviderSourceSystemDefault { - forcedPathStyle = true + forcedPathStyle := true + if storage.Provider == setting.ProviderSourceAli { + forcedPathStyle = false } client, err := s3tool.NewClient(storage.Endpoint, storage.Ak, storage.Sk, storage.Insecure, forcedPathStyle) if err != nil { diff --git a/pkg/microservice/reaper/core/service/archive/file_archive.go b/pkg/microservice/reaper/core/service/archive/file_archive.go index bb9722e6df..fc915ce0c3 100644 --- a/pkg/microservice/reaper/core/service/archive/file_archive.go +++ b/pkg/microservice/reaper/core/service/archive/file_archive.go @@ -212,9 +212,9 @@ func (c *WorkspaceAchiever) Achieve(target string) error { //} if store, err := s3.NewS3StorageFromEncryptedURI(c.StorageURI); err == nil { - forcedPathStyle := false - if store.Provider == setting.ProviderSourceSystemDefault { - forcedPathStyle = true + forcedPathStyle := true + if store.Provider == setting.ProviderSourceAli { + forcedPathStyle = false } s3client, err := s3tool.NewClient(store.Endpoint, store.Ak, store.Sk, store.Insecure, forcedPathStyle) if err != nil { diff --git a/pkg/microservice/reaper/core/service/reaper/archive.go b/pkg/microservice/reaper/core/service/reaper/archive.go index 420a81bbad..b729ce665d 100644 --- a/pkg/microservice/reaper/core/service/reaper/archive.go +++ b/pkg/microservice/reaper/core/service/reaper/archive.go @@ -43,9 +43,9 @@ func (r *Reaper) archiveS3Files() (err error) { } else { store.Subfolder = fmt.Sprintf("%s/%d/%s", r.Ctx.PipelineName, r.Ctx.TaskID, "file") } - forcedPathStyle := false - if store.Provider == setting.ProviderSourceSystemDefault { - forcedPathStyle = true + forcedPathStyle := true + if store.Provider == setting.ProviderSourceAli { + forcedPathStyle = false } s3client, err := s3tool.NewClient(store.Endpoint, store.Ak, store.Sk, store.Insecure, forcedPathStyle) if err != nil { @@ -100,9 +100,9 @@ func (r *Reaper) archiveTestFiles() error { //log.Warningf("upload filepath not exist") return nil } - forcedPathStyle := false - if store.Provider == setting.ProviderSourceSystemDefault { - forcedPathStyle = true + forcedPathStyle := true + if store.Provider == setting.ProviderSourceAli { + forcedPathStyle = false } s3client, err := s3tool.NewClient(store.Endpoint, store.Ak, store.Sk, store.Insecure, forcedPathStyle) if err != nil { @@ -152,9 +152,9 @@ func (r *Reaper) archiveHTMLTestReportFile() error { } fileName := filepath.Base(r.Ctx.Archive.TestReportFile) - forcedPathStyle := false - if store.Provider == setting.ProviderSourceSystemDefault { - forcedPathStyle = true + forcedPathStyle := true + if store.Provider == setting.ProviderSourceAli { + forcedPathStyle = false } s3client, err := s3tool.NewClient(store.Endpoint, store.Ak, store.Sk, store.Insecure, forcedPathStyle) if err != nil { diff --git a/pkg/microservice/reaper/core/service/reaper/artifact.go b/pkg/microservice/reaper/core/service/reaper/artifact.go index bec6bc2ec1..ff93b4ff84 100644 --- a/pkg/microservice/reaper/core/service/reaper/artifact.go +++ b/pkg/microservice/reaper/core/service/reaper/artifact.go @@ -75,9 +75,9 @@ func artifactsUpload(ctx *meta.Context, activeWorkspace string) error { } if store != nil { - forcedPathStyle := false - if store.Provider == setting.ProviderSourceSystemDefault { - forcedPathStyle = true + forcedPathStyle := true + if store.Provider == setting.ProviderSourceAli { + forcedPathStyle = false } s3client, err := s3tool.NewClient(store.Endpoint, store.Ak, store.Sk, store.Insecure, forcedPathStyle) if err != nil { diff --git a/pkg/microservice/reaper/core/service/reaper/cachemanager.go b/pkg/microservice/reaper/core/service/reaper/cachemanager.go index 119c2fe9d0..cac9050921 100644 --- a/pkg/microservice/reaper/core/service/reaper/cachemanager.go +++ b/pkg/microservice/reaper/core/service/reaper/cachemanager.go @@ -118,9 +118,9 @@ func (gcm *TarCacheManager) Archive(source, dest string) error { //} if store, err := gcm.getS3Storage(); err == nil { - forcedPathStyle := false - if store.Provider == setting.ProviderSourceSystemDefault { - forcedPathStyle = true + forcedPathStyle := true + if store.Provider == setting.ProviderSourceAli { + forcedPathStyle = false } s3client, err := s3tool.NewClient(store.Endpoint, store.Ak, store.Sk, store.Insecure, forcedPathStyle) if err != nil { @@ -139,9 +139,9 @@ func (gcm *TarCacheManager) Archive(source, dest string) error { func (gcm *TarCacheManager) Unarchive(source, dest string) error { if store, err := gcm.getS3Storage(); err == nil { - forcedPathStyle := false - if store.Provider == setting.ProviderSourceSystemDefault { - forcedPathStyle = true + forcedPathStyle := true + if store.Provider == setting.ProviderSourceAli { + forcedPathStyle = false } s3client, err := s3tool.NewClient(store.Endpoint, store.Ak, store.Sk, store.Insecure, forcedPathStyle) if err != nil { diff --git a/pkg/microservice/reaper/core/service/reaper/script.go b/pkg/microservice/reaper/core/service/reaper/script.go index ab907a2ea5..bbe55ba357 100644 --- a/pkg/microservice/reaper/core/service/reaper/script.go +++ b/pkg/microservice/reaper/core/service/reaper/script.go @@ -83,9 +83,9 @@ func (r *Reaper) runIntallationScripts() error { filepath := strings.Split(install.Download, "/") fileName := filepath[len(filepath)-1] tmpPath = path.Join(os.TempDir(), fileName) - forcedPathStyle := false - if store.Provider == setting.ProviderSourceSystemDefault { - forcedPathStyle = true + forcedPathStyle := true + if store.Provider == setting.ProviderSourceAli { + forcedPathStyle = false } s3client, err := s3tool.NewClient(store.Endpoint, store.Ak, store.Sk, store.Insecure, forcedPathStyle) if err == nil { diff --git a/pkg/microservice/warpdrive/core/service/taskcontroller/task_helper.go b/pkg/microservice/warpdrive/core/service/taskcontroller/task_helper.go index 4d0ee89284..867b82e336 100644 --- a/pkg/microservice/warpdrive/core/service/taskcontroller/task_helper.go +++ b/pkg/microservice/warpdrive/core/service/taskcontroller/task_helper.go @@ -217,7 +217,7 @@ func getCheckStatus(status config.Status) github.CIStatus { case config.StatusSkipped: return github.CIStatusCancelled case config.StatusCancelled: - return github.CIStatusCancelled + return github.CIStatusCancelled default: return github.CIStatusError } @@ -483,9 +483,9 @@ func downloadReport(taskInfo *task.Task, fileName, testName string, logger *zap. logger.Errorf("failed to create s3 storage %s", taskInfo.StorageURI) return nil, err } - forcedPathStyle := false - if store.Provider == setting.ProviderSourceSystemDefault { - forcedPathStyle = true + forcedPathStyle := true + if store.Provider == setting.ProviderSourceAli { + forcedPathStyle = false } client, err := s3tool.NewClient(store.Endpoint, store.Ak, store.Sk, store.Insecure, forcedPathStyle) if err != nil { diff --git a/pkg/microservice/warpdrive/core/service/taskplugin/deploy.go b/pkg/microservice/warpdrive/core/service/taskplugin/deploy.go index db26ba41a8..1d6eac8391 100644 --- a/pkg/microservice/warpdrive/core/service/taskplugin/deploy.go +++ b/pkg/microservice/warpdrive/core/service/taskplugin/deploy.go @@ -489,9 +489,9 @@ func (p *DeployTaskPlugin) downloadService(pipelineTask *task.Task, serviceName, filePath := fmt.Sprintf("%s.tar.gz", serviceName) tarFilePath := path.Join(base, filePath) - forcedPathStyle := false - if s3Storage.Provider == setting.ProviderSourceSystemDefault { - forcedPathStyle = true + forcedPathStyle := true + if s3Storage.Provider == setting.ProviderSourceAli { + forcedPathStyle = false } s3client, err := s3tool.NewClient(s3Storage.Endpoint, s3Storage.Ak, s3Storage.Sk, s3Storage.Insecure, forcedPathStyle) if err != nil { diff --git a/pkg/microservice/warpdrive/core/service/taskplugin/distribute_kodo.go b/pkg/microservice/warpdrive/core/service/taskplugin/distribute_kodo.go index 847eb0916d..3704e464f7 100644 --- a/pkg/microservice/warpdrive/core/service/taskplugin/distribute_kodo.go +++ b/pkg/microservice/warpdrive/core/service/taskplugin/distribute_kodo.go @@ -103,9 +103,9 @@ func upload(ctx context.Context, log *zap.SugaredLogger, storage *s3.S3, localfi return err } - forcedPathStyle := false - if storage.Provider == setting.ProviderSourceSystemDefault { - forcedPathStyle = true + forcedPathStyle := true + if storage.Provider == setting.ProviderSourceAli { + forcedPathStyle = false } client, err := s3tool.NewClient(storage.Endpoint, storage.Ak, storage.Sk, storage.Insecure, forcedPathStyle) if err != nil { @@ -160,9 +160,9 @@ func (p *Distribute2S3TaskPlugin) Run(ctx context.Context, pipelineTask *task.Ta defer func() { _ = os.Remove(tmpFile.Name()) }() - forcedPathStyle := false - if srcStorage.Provider == setting.ProviderSourceSystemDefault { - forcedPathStyle = true + forcedPathStyle := true + if srcStorage.Provider == setting.ProviderSourceAli { + forcedPathStyle = false } s3client, err := s3tool.NewClient(srcStorage.Endpoint, srcStorage.Ak, srcStorage.Sk, srcStorage.Insecure, forcedPathStyle) if err != nil { diff --git a/pkg/microservice/warpdrive/core/service/taskplugin/job.go b/pkg/microservice/warpdrive/core/service/taskplugin/job.go index 5d19e67129..2d4fc20a83 100644 --- a/pkg/microservice/warpdrive/core/service/taskplugin/job.go +++ b/pkg/microservice/warpdrive/core/service/taskplugin/job.go @@ -113,9 +113,9 @@ func saveContainerLog(pipelineTask *task.Task, namespace, fileName string, jobLa } else { store.Subfolder = fmt.Sprintf("%s/%d/%s", pipelineTask.PipelineName, pipelineTask.TaskID, "log") } - forcedPathStyle := false - if store.Provider == setting.ProviderSourceSystemDefault { - forcedPathStyle = true + forcedPathStyle := true + if store.Provider == setting.ProviderSourceAli { + forcedPathStyle = false } s3client, err := s3tool.NewClient(store.Endpoint, store.Ak, store.Sk, store.Insecure, forcedPathStyle) if err != nil { diff --git a/pkg/microservice/warpdrive/core/service/taskplugin/testing.go b/pkg/microservice/warpdrive/core/service/taskplugin/testing.go index 8831206a36..d61273c002 100644 --- a/pkg/microservice/warpdrive/core/service/taskplugin/testing.go +++ b/pkg/microservice/warpdrive/core/service/taskplugin/testing.go @@ -310,9 +310,9 @@ func (p *TestPlugin) Complete(ctx context.Context, pipelineTask *task.Task, serv } else { store.Subfolder = fmt.Sprintf("%s/%d/%s", pipelineName, pipelineTaskID, "artifact") } - forcedPathStyle := false - if store.Provider == setting.ProviderSourceSystemDefault { - forcedPathStyle = true + forcedPathStyle := true + if store.Provider == setting.ProviderSourceAli { + forcedPathStyle = false } s3client, err := s3tool.NewClient(store.Endpoint, store.Ak, store.Sk, store.Insecure, forcedPathStyle) if err == nil {