Fail fast when image is specified w/o tag

This commit is contained in:
Maciej Szulik 2021-04-20 18:51:50 +02:00
parent 41505f7109
commit 89b50bcf94
No known key found for this signature in database
GPG Key ID: F15E55D276FA84C4

View File

@ -373,6 +373,9 @@ func ReplaceRegistryInImageURL(imageURL string) (string, error) {
}
}
last := strings.SplitN(parts[countParts-1], ":", 2)
if len(last) == 1 {
return "", fmt.Errorf("image %q is required to be in an image:tag format", imageURL)
}
config := getRepositoryMappedConfig(index, Config{
registry: parts[0],
name: strings.Join([]string{strings.Join(parts[1:countParts-1], "/"), last[0]}, "/"),