Skip to content

Commit

Permalink
podman: mirror information
Browse files Browse the repository at this point in the history
Updates the podman info command to show the mirror information

Issue containers#4553

Signed-off-by: José Guilherme Vanz <jvanz@jvanz.com>
  • Loading branch information
jvanz committed Dec 12, 2019
1 parent 465e142 commit d675a3a
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 16 deletions.
6 changes: 6 additions & 0 deletions install.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,12 @@ sudo apt-get install \
uidmap
```

On openSUSE Leap:

```bash
sudo zypper -n in libseccomp-devel libgpgme-devel
```

On Manjaro (and maybe other Linux distributions):

Make sure that the Linux kernel supports user namespaces:
Expand Down
17 changes: 4 additions & 13 deletions libpod/runtime.go
Original file line number Diff line number Diff line change
Expand Up @@ -691,24 +691,15 @@ 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()
regData, err := sysreg.GetRegistriesData()
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")
for _, reg := range regData {
registries[reg.Prefix] = reg
}
registries["blocked"] = breg

info = append(info, define.InfoData{Type: "registries", Data: registries})
return info, nil
}
Expand Down
7 changes: 4 additions & 3 deletions pkg/registries/registries.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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
}
Expand All @@ -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
}
Expand Down

0 comments on commit d675a3a

Please sign in to comment.