From d1a7378aa06eb3cc6ff02c3ca90356bf9a151ada Mon Sep 17 00:00:00 2001 From: Daniel J Walsh Date: Fri, 3 May 2019 09:34:34 -0400 Subject: change from sysregistries to sysregistriesv2 We want to start supporting the registries.conf format. Also start showing blocked registries in podman info Fix sorting so all registries are listed together in podman info. Signed-off-by: Daniel J Walsh --- libpod/image/pull.go | 4 +--- libpod/runtime.go | 16 ++++++++++------ 2 files changed, 11 insertions(+), 9 deletions(-) (limited to 'libpod') diff --git a/libpod/image/pull.go b/libpod/image/pull.go index 5a0706b07..cb7411ce5 100644 --- a/libpod/image/pull.go +++ b/libpod/image/pull.go @@ -13,7 +13,6 @@ import ( dockerarchive "github.com/containers/image/docker/archive" "github.com/containers/image/docker/tarfile" ociarchive "github.com/containers/image/oci/archive" - "github.com/containers/image/pkg/sysregistries" is "github.com/containers/image/storage" "github.com/containers/image/transports" "github.com/containers/image/transports/alltransports" @@ -284,9 +283,8 @@ func (ir *Runtime) doPullImage(ctx context.Context, sc *types.SystemContext, goa } // If no image was found, we should handle. Lets be nicer to the user and see if we can figure out why. if len(images) == 0 { - registryPath := sysregistries.RegistriesConfPath(&types.SystemContext{SystemRegistriesConfPath: systemRegistriesConfPath}) if goal.usedSearchRegistries && len(goal.searchedRegistries) == 0 { - return nil, errors.Errorf("image name provided is a short name and no search registries are defined in %s.", registryPath) + return nil, errors.Errorf("image name provided is a short name and no search registries are defined in the registries config file.") } // If the image passed in was fully-qualified, we will have 1 refpair. Bc the image is fq'd, we dont need to yap about registries. if !goal.usedSearchRegistries { diff --git a/libpod/runtime.go b/libpod/runtime.go index 6b8d97fd9..34b6ac74f 100644 --- a/libpod/runtime.go +++ b/libpod/runtime.go @@ -1122,16 +1122,20 @@ func (r *Runtime) Info() ([]InfoData, error) { return nil, errors.Wrapf(err, "error getting registries") } registries := make(map[string]interface{}) - registries["registries"] = reg - info = append(info, InfoData{Type: "registries", Data: registries}) + registries["search"] = reg + + ireg, err := sysreg.GetInsecureRegistries() + if err != nil { + return nil, errors.Wrapf(err, "error getting registries") + } + registries["insecure"] = ireg - i, err := sysreg.GetInsecureRegistries() + breg, err := sysreg.GetBlockedRegistries() if err != nil { return nil, errors.Wrapf(err, "error getting registries") } - insecureRegistries := make(map[string]interface{}) - insecureRegistries["registries"] = i - info = append(info, InfoData{Type: "insecure registries", Data: insecureRegistries}) + registries["blocked"] = breg + info = append(info, InfoData{Type: "registries", Data: registries}) return info, nil } -- cgit v1.2.3-54-g00ecf