Skip to content

Commit

Permalink
registry: ensure docker.io is blocked
Browse files Browse the repository at this point in the history
Fix BZ#1395401

Signed-off-by: Antonio Murdaca <runcom@redhat.com>
  • Loading branch information
runcom committed Dec 13, 2016
1 parent 8ae67b4 commit fed041a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions distribution/pull.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ func Pull(ctx context.Context, ref reference.Named, imagePullConfig *ImagePullCo
if reference.IsReferenceFullyQualified(ref) {
return pullFromRegistry(ctx, ref, imagePullConfig)
}
// TODO(runcom): this should be moved before the check above for consistency...
if len(registry.DefaultRegistries) == 0 {
return fmt.Errorf("No configured registry to pull from.")
}
Expand Down
3 changes: 3 additions & 0 deletions registry/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,9 @@ func newRepositoryInfo(config *serviceConfig, name reference.Named) (*Repository
// IsIndexBlocked allows to check whether index/registry or endpoint
// is on a block list.
func IsIndexBlocked(indexName string) bool {
if indexName == DefaultV2Registry.Host || indexName == DefaultV1Registry.Host {
indexName = IndexName
}
if _, ok := BlockedRegistries[indexName]; ok {
return true
}
Expand Down

0 comments on commit fed041a

Please sign in to comment.