cmd/containerbuild/main.go: fix docker tag parsing (#260)

Change the parsing of repository and tag to match the last colon. This fixes container builds when the repository already contains an earlier colon.

Signed-off-by: rayer <70722312+rayes0@users.noreply.github.com>
This commit is contained in:
rayer 2025-04-13 19:58:43 +00:00 committed by GitHub
parent 62e20a213a
commit 3438595f32
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -123,10 +123,10 @@ func parseImageList(imageList string) ([]image, error) {
// reg.xeiaso.net/techaro/anubis:latest
// repository: reg.xeiaso.net/techaro/anubis
// tag: latest
parts := strings.SplitN(img, ":", 2)
index := strings.LastIndex(img, ":")
result = append(result, image{
repository: parts[0],
tag: parts[1],
repository: img[:index],
tag: img[index+1:],
})
}