Skip to content
Permalink
Browse files
fix(images-imports): added import type=ImageID into validation
  • Loading branch information
distorhead committed Jan 31, 2022
1 parent 6298d3d commit b58eb07db429e89b72cecae2d50162872a2786ca
Showing with 2 additions and 2 deletions.
  1. +1 −1 pkg/config/dependency_import.go
  2. +1 −1 pkg/docker_registry/api.go
@@ -15,7 +15,7 @@ type DependencyImport struct {

func (i *DependencyImport) validate() error {
switch i.Type {
case ImageNameImport, ImageTagImport, ImageRepoImport:
case ImageNameImport, ImageTagImport, ImageRepoImport, ImageIDImport:
default:
return newDetailedConfigError(fmt.Sprintf("invalid `type: %s` for dependency import, expected one of: %s", i.Type, strings.Join([]string{string(ImageNameImport), string(ImageTagImport), string(ImageRepoImport)}, ", ")), i.raw, i.raw.rawDependency.doc())
}
@@ -349,7 +349,7 @@ func (api *api) ParseReferenceParts(reference string) (referenceParts, error) {
// validate reference
parsedReference, err := name.ParseReference(reference, api.parseReferenceOptions()...)
if err != nil {
return referenceParts{}, fmt.Errorf("unable to parse reference: %s", err)
return referenceParts{}, fmt.Errorf("unable to parse reference %q: %s", reference, err)
}

res := dockerReference.ReferenceRegexp.FindStringSubmatch(reference)

0 comments on commit b58eb07

Please sign in to comment.