Skip to content

Commit

Permalink
Merge pull request #5034 from haircommander/do-not-block-image-1.20
Browse files Browse the repository at this point in the history
[1.20] pull: do check for blocked registries
  • Loading branch information
openshift-merge-robot committed Jun 28, 2021
2 parents 0d0f863 + e3e2788 commit 41925ef
Showing 1 changed file with 0 additions and 18 deletions.
18 changes: 0 additions & 18 deletions internal/storage/image.go
Original file line number Diff line number Diff line change
Expand Up @@ -783,14 +783,6 @@ func (svc *imageService) ResolveNames(systemContext *types.SystemContext, imageN

domain, remainder := splitDockerDomain(imageName)
if domain != "" {
// this means the image is already fully qualified
registry, err := sysregistriesv2.FindRegistry(systemContext, imageName)
if err != nil {
return nil, err
}
if registry != nil && registry.Blocked {
return nil, fmt.Errorf("cannot use %q because it's blocked", imageName)
}
return imageNamesWithDigestOrTag([]string{imageName})
}
UnqualifiedSearchRegistries, err := sysregistriesv2.UnqualifiedSearchRegistries(systemContext)
Expand All @@ -812,18 +804,8 @@ func (svc *imageService) ResolveNames(systemContext *types.SystemContext, imageN
rem = "library/" + rem
}
image := r + "/" + rem
registry, err := sysregistriesv2.FindRegistry(systemContext, image)
if err != nil {
return nil, err
}
if registry != nil && registry.Blocked {
continue
}
images = append(images, image)
}
if len(images) == 0 {
return nil, fmt.Errorf("all search registries for %q are blocked", remainder)
}
return imageNamesWithDigestOrTag(images)
}

Expand Down

0 comments on commit 41925ef

Please sign in to comment.