diff options
author | Giuseppe Scrivano <gscrivan@redhat.com> | 2018-11-13 10:00:41 +0100 |
---|---|---|
committer | Giuseppe Scrivano <gscrivan@redhat.com> | 2018-11-19 12:11:07 +0100 |
commit | a0079d76572612e0f620cb4d3f481cef1e91e762 (patch) | |
tree | 92516079a3041e7c7403a4a52dbf6498209bf82b /pkg/registries | |
parent | 937eb8413c24392e6c2d5818bfa2ddddf8e84b95 (diff) | |
download | podman-a0079d76572612e0f620cb4d3f481cef1e91e762.tar.gz podman-a0079d76572612e0f620cb4d3f481cef1e91e762.tar.bz2 podman-a0079d76572612e0f620cb4d3f481cef1e91e762.zip |
registries: check user registries file only in rootless mode
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Diffstat (limited to 'pkg/registries')
-rw-r--r-- | pkg/registries/registries.go | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/pkg/registries/registries.go b/pkg/registries/registries.go index 73aa93d68..c26f15cb6 100644 --- a/pkg/registries/registries.go +++ b/pkg/registries/registries.go @@ -38,8 +38,10 @@ func GetRegistries() ([]string, error) { func GetInsecureRegistries() ([]string, error) { registryConfigPath := "" - if _, err := os.Stat(userRegistriesFile); err == nil { - registryConfigPath = userRegistriesFile + if rootless.IsRootless() { + if _, err := os.Stat(userRegistriesFile); err == nil { + registryConfigPath = userRegistriesFile + } } envOverride := os.Getenv("REGISTRIES_CONFIG_PATH") |