[Cmii][ImageSync] -Image Function accomplish -1
This commit is contained in:
@@ -101,7 +101,23 @@ func ImageFullNameToGzipFileName(imageFullName string) (gzipFileName string) {
|
||||
|
||||
func ImageFullNameToTargetImageFullName(imageFullName, targetHost string) string {
|
||||
|
||||
return imageFullName
|
||||
if strings.HasPrefix(imageFullName, CmiiHarborPrefix) {
|
||||
imageFullName = strings.TrimPrefix(imageFullName, CmiiHarborPrefix)
|
||||
} else if strings.HasPrefix(imageFullName, "docker.io") {
|
||||
imageFullName = strings.TrimPrefix(imageFullName, "docker.io")
|
||||
}
|
||||
// rancher/123:v123
|
||||
if strings.HasPrefix(imageFullName, "rancher") {
|
||||
return targetHost + "/" + imageFullName
|
||||
}
|
||||
// ossr/srs:v4.0.5
|
||||
if strings.Contains(imageFullName, "/") {
|
||||
imageFullName = strings.Split(imageFullName, "/")[1]
|
||||
}
|
||||
|
||||
// srs:v4.0.5
|
||||
// cmii-uav-platform:5.4.0
|
||||
return targetHost + "/cmii/" + imageFullName
|
||||
}
|
||||
|
||||
func GzipFileNameToImageFullName(gzipFileName string) (imageFullName string) {
|
||||
|
||||
Reference in New Issue
Block a user