mirror of https://github.com/containers/podman.git
podman: mirror information
Updates the podman info command to show the mirror information Issue https://github.com/containers/libpod/issues/4553 Signed-off-by: José Guilherme Vanz <jvanz@jvanz.com>
This commit is contained in:
parent
465e142bf2
commit
4f9672e94c
|
@ -691,24 +691,15 @@ func (r *Runtime) Info() ([]define.InfoData, error) {
|
||||||
}
|
}
|
||||||
info = append(info, define.InfoData{Type: "store", Data: storeInfo})
|
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 := make(map[string]interface{})
|
||||||
registries["search"] = reg
|
regData, err := sysreg.GetRegistriesData()
|
||||||
|
|
||||||
ireg, err := sysreg.GetInsecureRegistries()
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, errors.Wrapf(err, "error getting registries")
|
return nil, errors.Wrapf(err, "error getting registries")
|
||||||
}
|
}
|
||||||
registries["insecure"] = ireg
|
for _, reg := range regData {
|
||||||
|
registries[reg.Prefix] = reg
|
||||||
breg, err := sysreg.GetBlockedRegistries()
|
|
||||||
if err != nil {
|
|
||||||
return nil, errors.Wrapf(err, "error getting registries")
|
|
||||||
}
|
}
|
||||||
registries["blocked"] = breg
|
|
||||||
info = append(info, define.InfoData{Type: "registries", Data: registries})
|
info = append(info, define.InfoData{Type: "registries", Data: registries})
|
||||||
return info, nil
|
return info, nil
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,7 +34,8 @@ func SystemRegistriesConfPath() string {
|
||||||
return ""
|
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()})
|
registries, err := sysregistriesv2.GetRegistries(&types.SystemContext{SystemRegistriesConfPath: SystemRegistriesConfPath()})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, errors.Wrapf(err, "unable to parse the registries.conf file")
|
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.
|
// GetBlockedRegistries obtains the list of blocked registries defined in the global registries file.
|
||||||
func GetBlockedRegistries() ([]string, error) {
|
func GetBlockedRegistries() ([]string, error) {
|
||||||
var blockedRegistries []string
|
var blockedRegistries []string
|
||||||
registries, err := getRegistries()
|
registries, err := GetRegistriesData()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
@ -65,7 +66,7 @@ func GetBlockedRegistries() ([]string, error) {
|
||||||
// GetInsecureRegistries obtains the list of insecure registries from the global registration file.
|
// GetInsecureRegistries obtains the list of insecure registries from the global registration file.
|
||||||
func GetInsecureRegistries() ([]string, error) {
|
func GetInsecureRegistries() ([]string, error) {
|
||||||
var insecureRegistries []string
|
var insecureRegistries []string
|
||||||
registries, err := getRegistries()
|
registries, err := GetRegistriesData()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue