registries: check user registries file only in rootless mode
@@ -38,9 +38,11 @@ func GetRegistries() ([]string, error) {
func GetInsecureRegistries() ([]string, error) {
registryConfigPath := ""
+ if rootless.IsRootless() {
if _, err := os.Stat(userRegistriesFile); err == nil {
registryConfigPath = userRegistriesFile
}
+ }
envOverride := os.Getenv("REGISTRIES_CONFIG_PATH")
if len(envOverride) > 0 {
