[agent-operator] - minio refresh
This commit is contained in:
@@ -9,6 +9,7 @@ import (
|
||||
"path/filepath"
|
||||
"slices"
|
||||
"strings"
|
||||
|
||||
image2 "wdd.io/agent-common/image"
|
||||
"wdd.io/agent-common/utils"
|
||||
"wdd.io/agent-operator/image"
|
||||
@@ -179,7 +180,7 @@ func DownloadCompressUpload(fullNameList []string, shouldGzip bool, gzipFolderFu
|
||||
// extract demo oss location suffix from gzipFolderFullPath
|
||||
trimPrefix := strings.TrimPrefix(gzipFolderFullPath, OfflineImageGzipFolderPrefix)
|
||||
bucketName := "cmlc-installation/" + trimPrefix
|
||||
log.InfoF("gzip file location in demo oss is %s", DemoEndpoint+"/"+bucketName)
|
||||
log.InfoF("gzip file location in demo oss is %s", DefaultDemoEndpoint+"/"+bucketName)
|
||||
|
||||
minioOperator := CmiiMinioOperator{}
|
||||
for _, gzipFileName := range allGzipFileNameList {
|
||||
@@ -195,16 +196,16 @@ func DownloadCompressUpload(fullNameList []string, shouldGzip bool, gzipFolderFu
|
||||
}
|
||||
|
||||
// DownloadLoadTagPush DLTU procedure ImageSync的另外一般流程,需要支持 堡垒机(纯离线)的模式
|
||||
// 1. 文件模式,从文件中读取全部的镜像全名称-写死到文件中
|
||||
// 2. Gzip文件目录,RKE MIDDLE CMII三个文件目录 - 是否需要约定目录
|
||||
// 2. Gzip文件目录,RKE MIDDLE CMII三个文件目录 - 约定目录
|
||||
// 约定目录 /root/wdd/image/rke/ /root/wdd/image/middle/ /root/wdd/image/cmii/
|
||||
// 3. 读取本机的IP地址 - 或者进行参数传递
|
||||
// 4. OSS地址 - 参数传递gizpFileName
|
||||
func DownloadLoadTagPush(downloadFromOss bool, ossUrlPrefix, localGzipFolder string, targetHarborFullName string) []string {
|
||||
// 3. 读取本机的IP地址 - 参数传递
|
||||
// 4. OSS地址 - ossUrlPrefix传空 则使用默认值
|
||||
// 5. ossFileName - 如果结尾为txt,则为文件的形式,如果为tar.gz,则为gzip文件夹的形式
|
||||
func DownloadLoadTagPush(downloadFromOss bool, ossUrlPrefix, ossFileName, localGzipFolder string, targetHarborFullName string) []string {
|
||||
|
||||
// download
|
||||
if downloadFromOss {
|
||||
parseAndDownloadFromOssUrlPrefix(ossUrlPrefix, localGzipFolder)
|
||||
parseAndDownloadFromOss(ossUrlPrefix, ossFileName, localGzipFolder)
|
||||
}
|
||||
// load
|
||||
loadAllGzipImageFromLocalFolder(localGzipFolder)
|
||||
@@ -246,8 +247,28 @@ func loadAllGzipImageFromLocalFolder(localGzipFolder string) {
|
||||
|
||||
}
|
||||
|
||||
// todo
|
||||
func parseAndDownloadFromOssUrlPrefix(ossUrlPrefix string, localGzipFolder string) {
|
||||
func parseAndDownloadFromOss(ossUrlPrefix, ossFileName, localGzipFolder string) {
|
||||
|
||||
if ossUrlPrefix == "" {
|
||||
ossUrlPrefix = DefaultOssUrlPrefix
|
||||
}
|
||||
log.InfoF("prepare to download from %s%s", ossUrlPrefix, ossFileName)
|
||||
|
||||
// get oss endpoint
|
||||
// mc login
|
||||
|
||||
if strings.HasSuffix(ossFileName, ".txt") {
|
||||
// a list of files
|
||||
|
||||
}
|
||||
|
||||
if strings.HasSuffix(ossFileName, ".tar.gz") {
|
||||
// single gzip file
|
||||
}
|
||||
|
||||
// mv list all gzip file name
|
||||
|
||||
// download all gzip files to local folder
|
||||
|
||||
// 解析
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user