[agent-operator] - update dltu part
This commit is contained in:
@@ -33,7 +33,7 @@ func RealProjectRunner() {
|
||||
|
||||
op := CmiiK8sOperator{}
|
||||
op.BuildCurrentClientFromConfig(readFile)
|
||||
CmiiOperator = op
|
||||
DefaultCmiiOperator = op
|
||||
|
||||
// ops
|
||||
|
||||
@@ -77,7 +77,7 @@ func CmiiRunner() {
|
||||
|
||||
var DLTUHelp = `
|
||||
DLTUHelp
|
||||
dltu [ossUrlPrefix] [ossFileName] [localGzipFolder] [harborHostFullName]
|
||||
dltu [ossUrlPrefix] [ossFileName] [localGzipFolder] [harborHostFullName] [namespace]
|
||||
`
|
||||
|
||||
func main() {
|
||||
@@ -113,7 +113,7 @@ func main() {
|
||||
result = append(result, text)
|
||||
}
|
||||
|
||||
if len(result) != 5 {
|
||||
if len(result) != 6 {
|
||||
fmt.Println("input error!")
|
||||
fmt.Printf(DLTUHelp)
|
||||
return
|
||||
@@ -123,11 +123,13 @@ func main() {
|
||||
ossFileName := result[2]
|
||||
localGzipFolder := result[3]
|
||||
harborHostFullName := result[4]
|
||||
namespace := result[5]
|
||||
|
||||
fmt.Println("ossUrlPrefix: ", ossUrlPrefix)
|
||||
fmt.Println("ossFileName: ", ossFileName)
|
||||
fmt.Println("localGzipFolder: ", localGzipFolder)
|
||||
fmt.Println("harborHostFullName: ", harborHostFullName)
|
||||
fmt.Println("namespace: ", namespace)
|
||||
fmt.Println()
|
||||
|
||||
downloadFromOss := true
|
||||
@@ -135,9 +137,17 @@ func main() {
|
||||
downloadFromOss = false
|
||||
}
|
||||
|
||||
DownloadLoadTagPush(downloadFromOss, ossUrlPrefix, ossFileName, localGzipFolder, harborHostFullName)
|
||||
// DLTU
|
||||
targetImageFullNameList := DownloadLoadTagUpload(downloadFromOss, ossUrlPrefix, ossFileName, localGzipFolder, harborHostFullName)
|
||||
|
||||
// 下载
|
||||
// 是否需要更新
|
||||
if namespace != "" {
|
||||
for _, targetImageFullName := range targetImageFullNameList {
|
||||
if !DefaultCmiiOperator.DeploymentUpdateTagByImageFullName(namespace, targetImageFullName) {
|
||||
fmt.Printf("[Update] update [%s] [%s] failed", namespace, targetImageFullName)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fmt.Println()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user