summaryrefslogtreecommitdiff
path: root/libpod/runtime.go
diff options
context:
space:
mode:
authorJosé Guilherme Vanz <jvanz@jvanz.com>2019-12-12 20:54:16 -0300
committerJosé Guilherme Vanz <jvanz@jvanz.com>2019-12-12 20:54:16 -0300
commit95d26e3f6f1b089968ea1eacf7c5af538ef27955 (patch)
tree2fefc8a928643d2e141ac051f702cf5bdf19ae9f /libpod/runtime.go
parent1b99651720fd46872a21cda3aebbb6ee7ac83c85 (diff)
downloadpodman-95d26e3f6f1b089968ea1eacf7c5af538ef27955.tar.gz
podman-95d26e3f6f1b089968ea1eacf7c5af538ef27955.tar.bz2
podman-95d26e3f6f1b089968ea1eacf7c5af538ef27955.zip
runtime.go: show search table in podman info
Updates the podman info command to show registries from v1 config file in the search table format. Signed-off-by: José Guilherme Vanz <jvanz@jvanz.com>
Diffstat (limited to 'libpod/runtime.go')
-rw-r--r--libpod/runtime.go26
1 files changed, 23 insertions, 3 deletions
diff --git a/libpod/runtime.go b/libpod/runtime.go
index c1b523cdf..5397e51f5 100644
--- a/libpod/runtime.go
+++ b/libpod/runtime.go
@@ -692,12 +692,32 @@ func (r *Runtime) Info() ([]define.InfoData, error) {
info = append(info, define.InfoData{Type: "store", Data: storeInfo})
registries := make(map[string]interface{})
- regData, err := sysreg.GetRegistriesData()
+ regs, err := sysreg.GetRegistries()
if err != nil {
return nil, errors.Wrapf(err, "error getting registries")
}
- for _, reg := range regData {
- registries[reg.Prefix] = reg
+ if len(regs) > 0 {
+ // v1 config file. We should use the search table format
+ registries["search"] = regs
+ ireg, err := sysreg.GetInsecureRegistries()
+ if err != nil {
+ return nil, errors.Wrapf(err, "error getting registries")
+ }
+ registries["insecure"] = ireg
+ breg, err := sysreg.GetBlockedRegistries()
+ if err != nil {
+ return nil, errors.Wrapf(err, "error getting registries")
+ }
+ registries["blocked"] = breg
+ } else {
+ // v2 config file. We can show the whole registry data
+ data, err := sysreg.GetRegistriesData()
+ if err != nil {
+ return nil, errors.Wrapf(err, "error getting registries")
+ }
+ for _, reg := range data {
+ registries[reg.Prefix] = reg
+ }
}
info = append(info, define.InfoData{Type: "registries", Data: registries})