diff options
Diffstat (limited to 'vendor/github.com/projectatomic/buildah/util.go')
-rw-r--r-- | vendor/github.com/projectatomic/buildah/util.go | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/vendor/github.com/projectatomic/buildah/util.go b/vendor/github.com/projectatomic/buildah/util.go index 4aa19b384..ef9be87fb 100644 --- a/vendor/github.com/projectatomic/buildah/util.go +++ b/vendor/github.com/projectatomic/buildah/util.go @@ -7,7 +7,7 @@ import ( "sync" "github.com/containers/image/docker/reference" - "github.com/containers/image/pkg/sysregistries" + "github.com/containers/image/pkg/sysregistriesv2" "github.com/containers/image/types" "github.com/containers/storage/pkg/archive" "github.com/containers/storage/pkg/chrootarchive" @@ -166,12 +166,18 @@ func (b *Builder) tarPath() func(path string) (io.ReadCloser, error) { } } -// getRegistries obtains the list of registries defined in the global registries file. +// getRegistries obtains the list of search registries defined in the global registries file. func getRegistries(sc *types.SystemContext) ([]string, error) { - searchRegistries, err := sysregistries.GetRegistries(sc) + var searchRegistries []string + registries, err := sysregistriesv2.GetRegistries(sc) if err != nil { return nil, errors.Wrapf(err, "unable to parse the registries.conf file") } + for _, registry := range sysregistriesv2.FindUnqualifiedSearchRegistries(registries) { + if !registry.Blocked { + searchRegistries = append(searchRegistries, registry.URL) + } + } return searchRegistries, nil } |