[agent-operator] - DLTU download from oss part

This commit is contained in:
zeaslity
2024-04-22 16:47:40 +08:00
parent c8bfb2b133
commit 30d83f3c61
4 changed files with 61 additions and 15 deletions

View File

@@ -143,15 +143,16 @@ func (op *MinioOperator) DownloadFileFromOssFullUrl(ossFullUrl string, filePath
return false
}
bucketName := split[0]
fileName := strings.Join(split[1:], "/")
//realFileName := split[len(split)-1]
ossFullUrl = strings.TrimPrefix(ossFullUrl, split[0]+"/")
bucketName := split[1]
fileName := strings.TrimPrefix(ossFullUrl, bucketName)
return op.DownloadFile(bucketName, filePath, fileName)
}
// DownloadFile objectName格式为 cmlc-installation/tmp/123/123.txt
// DownloadFile fileNameWithPrefix格式为 tmp/123/123.txt
func (op *MinioOperator) DownloadFile(bucketName, filePath, fileNameWithPrefix string) bool {
separator := os.PathSeparator