[ Cmii ] [ Octopus ] - add Image Function - 1
This commit is contained in:
@@ -17,9 +17,10 @@ const PublicDeployHarborHost = "42.192.52.227"
|
||||
const DirectPushDeployHarborHost = "36.134.71.138"
|
||||
|
||||
type ImageSyncEntity struct {
|
||||
ProjectName string
|
||||
ProjectVersion string
|
||||
DirectHarborHost string //此参数决定是否能够直连目标主机,如果有则代表直连,可以直接推送景象
|
||||
ProjectName string // 3
|
||||
ProjectVersion string // 2
|
||||
CmiiImageList map[string]string // 1
|
||||
DirectHarborHost string //此参数决定是否能够直连目标主机,如果有则代表直连,可以直接推送景象
|
||||
PushToDemoMinio bool
|
||||
}
|
||||
|
||||
@@ -32,7 +33,7 @@ type ImageSyncResult struct {
|
||||
AllCmiiImageNameList []string
|
||||
}
|
||||
|
||||
// PullFromEntityAndSyncConditionally 根据ImageSyncEntity拉取特定的镜像,然后上传到特定的目标机器
|
||||
// PullFromEntityAndSyncConditionally 根据ImageSyncEntity拉取特定的镜像,然后上传到特定的目标机器(或者上传的minio中)
|
||||
func (sync ImageSyncEntity) PullFromEntityAndSyncConditionally() (imageSyncResult ImageSyncResult) {
|
||||
|
||||
var realCmiiImageList []string
|
||||
@@ -122,20 +123,6 @@ func (sync ImageSyncEntity) PullFromEntityAndSyncConditionally() (imageSyncResul
|
||||
return imageSyncResult
|
||||
}
|
||||
|
||||
func remove(s1, s2 []string) []string {
|
||||
m := make(map[string]struct{}, len(s2))
|
||||
for _, v := range s2 {
|
||||
m[v] = struct{}{}
|
||||
}
|
||||
res := make([]string, 0, len(s1))
|
||||
for _, v := range s1 {
|
||||
if _, ok := m[v]; !ok {
|
||||
res = append(res, v)
|
||||
}
|
||||
}
|
||||
return res
|
||||
}
|
||||
|
||||
func FetchDemoImages(projectName string, gzipSplit bool) (errorPullImageList, errorGzipImageList, allCmiiImageName []string) {
|
||||
|
||||
// generate a project folder
|
||||
|
||||
Reference in New Issue
Block a user