fix: mirror warehouse image parsing error in ip:port format (#1867)

Signed-off-by: 张启航 <101104760+ZhangSetSail@users.noreply.github.com>
This commit is contained in:
张启航 2024-02-03 17:37:00 +08:00 committed by GitHub
parent 4a425b1b44
commit 3e977e665e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -325,7 +325,8 @@ func ParseImageName(s string) (i Image) {
}
i.name = name
i.Tag = sources.GetTagFromNamedRef(name)
if strings.Contains(s, ":") {
imageNameList := strings.Split(s, "/")
if strings.Contains(imageNameList[len(imageNameList)-1], ":") {
i.Name = s[:len(s)-(len(i.Tag)+1)]
} else {
i.Name = s