summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2019-12-17 14:05:15 +0100
committerGitHub <noreply@github.com>2019-12-17 14:05:15 +0100
commit1e440a3a3f7c7a1ac5896ae834e884c0dc3907f3 (patch)
tree7d47b76e16325f841ea729e203519bbf2b0a0707
parent43292040ab6841779def4872a4c337a77b05bfa0 (diff)
parent40f4a00eb344ad3848c5e84bffd8c2061311f0a9 (diff)
downloadpodman-1e440a3a3f7c7a1ac5896ae834e884c0dc3907f3.tar.gz
podman-1e440a3a3f7c7a1ac5896ae834e884c0dc3907f3.tar.bz2
podman-1e440a3a3f7c7a1ac5896ae834e884c0dc3907f3.zip
Merge pull request #4681 from jvanz/issue4553
podman: mirror information
-rw-r--r--docs/source/markdown/podman-info.1.md27
-rw-r--r--libpod/runtime.go20
-rw-r--r--pkg/registries/registries.go7
3 files changed, 33 insertions, 21 deletions
diff --git a/docs/source/markdown/podman-info.1.md b/docs/source/markdown/podman-info.1.md
index 9721755ef..b539f1d3c 100644
--- a/docs/source/markdown/podman-info.1.md
+++ b/docs/source/markdown/podman-info.1.md
@@ -53,13 +53,26 @@ host:
os: linux
uptime: 218h 49m 33.66s (Approximately 9.08 days)
registries:
- blocked: null
- insecure: null
- search:
- - quay.io
- - registry.fedoraproject.org
- - docker.io
- - registry.redhat.io
+ docker.io:
+ Blocked: true
+ Insecure: true
+ Location: docker.io
+ MirrorByDigestOnly: false
+ Mirrors:
+ - Insecure: true
+ Location: example2.io/example/ubi8-minimal
+ Prefix: docker.io
+ redhat.com:
+ Blocked: false
+ Insecure: false
+ Location: registry.access.redhat.com/ubi8
+ MirrorByDigestOnly: true
+ Mirrors:
+ - Insecure: false
+ Location: example.io/example/ubi8-minimal
+ - Insecure: true
+ Location: example3.io/example/ubi8-minimal
+ Prefix: redhat.com
store:
ConfigFile: /etc/containers/storage.conf
ContainerStore:
diff --git a/libpod/runtime.go b/libpod/runtime.go
index 3873079ce..001d850b0 100644
--- a/libpod/runtime.go
+++ b/libpod/runtime.go
@@ -691,24 +691,22 @@ func (r *Runtime) Info() ([]define.InfoData, error) {
}
info = append(info, define.InfoData{Type: "store", Data: storeInfo})
- reg, err := sysreg.GetRegistries()
- if err != nil {
- return nil, errors.Wrapf(err, "error getting registries")
- }
registries := make(map[string]interface{})
- registries["search"] = reg
-
- ireg, err := sysreg.GetInsecureRegistries()
+ data, err := sysreg.GetRegistriesData()
if err != nil {
return nil, errors.Wrapf(err, "error getting registries")
}
- registries["insecure"] = ireg
-
- breg, err := sysreg.GetBlockedRegistries()
+ for _, reg := range data {
+ registries[reg.Prefix] = reg
+ }
+ regs, err := sysreg.GetRegistries()
if err != nil {
return nil, errors.Wrapf(err, "error getting registries")
}
- registries["blocked"] = breg
+ if len(regs) > 0 {
+ registries["search"] = regs
+ }
+
info = append(info, define.InfoData{Type: "registries", Data: registries})
return info, nil
}
diff --git a/pkg/registries/registries.go b/pkg/registries/registries.go
index 9643c947f..ba7de7cf9 100644
--- a/pkg/registries/registries.go
+++ b/pkg/registries/registries.go
@@ -34,7 +34,8 @@ func SystemRegistriesConfPath() string {
return ""
}
-func getRegistries() ([]sysregistriesv2.Registry, error) {
+// GetRegistriesData obtains the list of registries
+func GetRegistriesData() ([]sysregistriesv2.Registry, error) {
registries, err := sysregistriesv2.GetRegistries(&types.SystemContext{SystemRegistriesConfPath: SystemRegistriesConfPath()})
if err != nil {
return nil, errors.Wrapf(err, "unable to parse the registries.conf file")
@@ -50,7 +51,7 @@ func GetRegistries() ([]string, error) {
// GetBlockedRegistries obtains the list of blocked registries defined in the global registries file.
func GetBlockedRegistries() ([]string, error) {
var blockedRegistries []string
- registries, err := getRegistries()
+ registries, err := GetRegistriesData()
if err != nil {
return nil, err
}
@@ -65,7 +66,7 @@ func GetBlockedRegistries() ([]string, error) {
// GetInsecureRegistries obtains the list of insecure registries from the global registration file.
func GetInsecureRegistries() ([]string, error) {
var insecureRegistries []string
- registries, err := getRegistries()
+ registries, err := GetRegistriesData()
if err != nil {
return nil, err
}