diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2019-02-18 13:32:54 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-02-18 13:32:54 +0100 |
commit | e738ef16225395f5f5e4b93ba1a43ae9449ae11b (patch) | |
tree | 00c7d016a064a6efdf96d7fbcf5deb5e56ddf9ee /pkg/varlinkapi | |
parent | f2139a651706b10824a1641a360020d932798827 (diff) | |
parent | b75dcd445848abad89e19f78193046a8de86c641 (diff) | |
download | podman-e738ef16225395f5f5e4b93ba1a43ae9449ae11b.tar.gz podman-e738ef16225395f5f5e4b93ba1a43ae9449ae11b.tar.bz2 podman-e738ef16225395f5f5e4b93ba1a43ae9449ae11b.zip |
Merge pull request #2354 from rhatdan/varlink
Add registry name to fields returned by varlink image search
Diffstat (limited to 'pkg/varlinkapi')
-rw-r--r-- | pkg/varlinkapi/images.go | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/pkg/varlinkapi/images.go b/pkg/varlinkapi/images.go index b3090d2dd..8deb4cbe2 100644 --- a/pkg/varlinkapi/images.go +++ b/pkg/varlinkapi/images.go @@ -446,9 +446,21 @@ func (i *LibpodAPI) SearchImages(call iopodman.VarlinkCall, query string, limit if tlsVerify != nil { sc.DockerInsecureSkipTLSVerify = types.NewOptionalBool(!*tlsVerify) } - registries, err := sysreg.GetRegistries() + var registries []string + + // Check if search query has a registry in it + registry, err := sysreg.GetRegistry(query) if err != nil { - return call.ReplyErrorOccurred(fmt.Sprintf("unable to get system registries: %q", err)) + return call.ReplyErrorOccurred(fmt.Sprintf("error getting registry from %q: %q", query, err)) + } + if registry != "" { + registries = append(registries, registry) + query = query[len(registry)+1:] + } else { + registries, err = sysreg.GetRegistries() + if err != nil { + return call.ReplyErrorOccurred(fmt.Sprintf("unable to get system registries: %q", err)) + } } var imageResults []iopodman.ImageSearchResult for _, reg := range registries { @@ -468,6 +480,7 @@ func (i *LibpodAPI) SearchImages(call iopodman.VarlinkCall, query string, limit } for _, result := range results { i := iopodman.ImageSearchResult{ + Registry: reg, Description: result.Description, Is_official: result.IsOfficial, Is_automated: result.IsAutomated, |