summaryrefslogtreecommitdiff
path: root/pkg/varlinkapi
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-01-09 10:40:20 +0100
committerGitHub <noreply@github.com>2020-01-09 10:40:20 +0100
commitf3fc10feb42930def6922fc050096ea38bafed7a (patch)
treeedf2dea05853dee9fb90bdfe3f07d3d810a0fe58 /pkg/varlinkapi
parentc99b413abbc74f6f7e126d8bca58f44a3fcd9c2d (diff)
parentd52a4dc2d48e0c660fea1449e9d24aa4acf5fe8a (diff)
downloadpodman-f3fc10feb42930def6922fc050096ea38bafed7a.tar.gz
podman-f3fc10feb42930def6922fc050096ea38bafed7a.tar.bz2
podman-f3fc10feb42930def6922fc050096ea38bafed7a.zip
Merge pull request #4802 from rhatdan/varlink
Fix podman-remote info to show registry data
Diffstat (limited to 'pkg/varlinkapi')
-rw-r--r--pkg/varlinkapi/system.go29
1 files changed, 15 insertions, 14 deletions
diff --git a/pkg/varlinkapi/system.go b/pkg/varlinkapi/system.go
index b81ff11ba..50aaaaa44 100644
--- a/pkg/varlinkapi/system.go
+++ b/pkg/varlinkapi/system.go
@@ -9,6 +9,7 @@ import (
goruntime "runtime"
"time"
+ "github.com/containers/image/v5/pkg/sysregistriesv2"
"github.com/containers/libpod/cmd/podman/varlink"
"github.com/containers/libpod/libpod/define"
"github.com/sirupsen/logrus"
@@ -37,9 +38,6 @@ func (i *LibpodAPI) GetInfo(call iopodman.VarlinkCall) error {
if err != nil {
return err
}
- var (
- registries, insecureRegistries []string
- )
podmanInfo := iopodman.PodmanInfo{}
info, err := i.Runtime.Info()
if err != nil {
@@ -90,22 +88,25 @@ func (i *LibpodAPI) GetInfo(call iopodman.VarlinkCall) error {
Graph_status: graphStatus,
}
+ // Registry information if any is stored as the second list item
if len(info) > 2 {
- registriesInterface := info[2].Data["registries"]
- if registriesInterface != nil {
- registries = registriesInterface.([]string)
- }
- }
- if len(info) > 3 {
- insecureRegistriesInterface := info[3].Data["registries"]
- if insecureRegistriesInterface != nil {
- insecureRegistries = insecureRegistriesInterface.([]string)
+ for key, val := range info[2].Data {
+ if key == "search" {
+ podmanInfo.Registries.Search = val.([]string)
+ continue
+ }
+ regData := val.(sysregistriesv2.Registry)
+ if regData.Insecure {
+ podmanInfo.Registries.Insecure = append(podmanInfo.Registries.Insecure, key)
+ }
+ if regData.Blocked {
+ podmanInfo.Registries.Blocked = append(podmanInfo.Registries.Blocked, key)
+ }
}
+
}
podmanInfo.Store = infoStore
podmanInfo.Podman = pmaninfo
- podmanInfo.Registries = registries
- podmanInfo.Insecure_registries = insecureRegistries
return call.ReplyGetInfo(podmanInfo)
}