[ Cmii ] [ Octopus ] - real project
This commit is contained in:
@@ -188,6 +188,7 @@ func ImageTagFromListAndPushToCHarbor(referenceImageList []string, targetHarborH
|
||||
pushResult := ImagePushToOctopusKindHarbor(targetImageName)
|
||||
if pushResult == nil {
|
||||
errorPushImageNameList = append(errorPushImageNameList, cmiiImageFullName)
|
||||
continue
|
||||
}
|
||||
scanner := bufio.NewScanner(pushResult)
|
||||
for scanner.Scan() {
|
||||
@@ -265,7 +266,6 @@ func ImagePullCMiiFromFileJson(filePathName string) {
|
||||
func ImagePullFromFullNameList(fullImageNameList []string) (errorPullImageList []string) {
|
||||
|
||||
for _, dep := range fullImageNameList {
|
||||
loginToDockerHub()
|
||||
|
||||
pullResult := ImagePullFromCmiiHarbor(dep)
|
||||
if pullResult == nil {
|
||||
@@ -451,16 +451,20 @@ func convertCMiiImageMapToList(cmiiImageVersionMap map[string]string) (fullImage
|
||||
return fullImageNameList
|
||||
}
|
||||
|
||||
func loginToDockerHub() {
|
||||
func loginToDockerHub(HarborFullHost string) {
|
||||
|
||||
if HarborFullHost == "" {
|
||||
HarborFullHost = "https://registry-1.docker.io"
|
||||
}
|
||||
|
||||
login, err := apiClient.RegistryLogin(context.TODO(), types.AuthConfig{
|
||||
Username: "icederce",
|
||||
Password: "loveff.cxc.23",
|
||||
Auth: "aWNlZGVyY2U6bG92ZWZmLmN4Yy4yMw==",
|
||||
ServerAddress: "https://registry-1.docker.io",
|
||||
ServerAddress: HarborFullHost,
|
||||
})
|
||||
if err != nil {
|
||||
log.ErrorF("[loginToDockerHub] - login failed !")
|
||||
log.ErrorF("[loginToDockerHub] - login to %s failed !", HarborFullHost)
|
||||
}
|
||||
|
||||
log.DebugF("[loginToDockerHub] - login is %s", login.Status)
|
||||
|
||||
Reference in New Issue
Block a user