[agent-go] - image sync entity
This commit is contained in:
@@ -204,20 +204,28 @@ func UploadToOctopusKindHarbor(targetImageName string) (pushResult io.ReadCloser
|
||||
}
|
||||
|
||||
func UploadToHarbor(targetImageName string) (uploadOK bool) {
|
||||
|
||||
pushResult := UploadToOctopusKindHarbor(targetImageName)
|
||||
|
||||
defer pushResult.Close()
|
||||
|
||||
scanner := bufio.NewScanner(pushResult)
|
||||
for scanner.Scan() {
|
||||
}
|
||||
|
||||
fmt.Println()
|
||||
log.InfoF("[UploadToHarbor] - upload %s success!", targetImageName)
|
||||
fmt.Println()
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
// TagFromListAndPushToCHarbor 需要支持 harbor.cdcyy.cn ip:8033 rancher/rancher:v2.5.7 nginx:latest
|
||||
func TagFromListAndPushToCHarbor(referenceImageList []string, targetHarborHost string) (errorPushImageNameList []string) {
|
||||
|
||||
targetHarborHost = strings.TrimPrefix(targetHarborHost, "http://")
|
||||
targetHarborHost = strings.TrimPrefix(targetHarborHost, "https://")
|
||||
|
||||
for _, imageName := range referenceImageList {
|
||||
|
||||
// check image
|
||||
@@ -247,7 +255,7 @@ func TagFromListAndPushToCHarbor(referenceImageList []string, targetHarborHost s
|
||||
}
|
||||
}
|
||||
|
||||
targetImageName := targetHarborHost + ":8033/" + targetProject + "/" + imageName
|
||||
targetImageName := targetHarborHost + targetProject + "/" + imageName
|
||||
//fmt.Println(cmiiImageFullName)
|
||||
//fmt.Println(targetImageName)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user