MCPcopy Create free account
hub / github.com/containers/image / registriesDirPathWithHomeDir

Function registriesDirPathWithHomeDir

docker/registries_d.go:93–106  ·  view source on GitHub ↗

registriesDirPathWithHomeDir is an internal implementation detail of registriesDirPath, it exists only to allow testing it with an artificial home directory.

(sys *types.SystemContext, homeDir string)

Source from the content-addressed store, hash-verified

91// registriesDirPathWithHomeDir is an internal implementation detail of registriesDirPath,
92// it exists only to allow testing it with an artificial home directory.
93func registriesDirPathWithHomeDir(sys *types.SystemContext, homeDir string) string {
94 if sys != nil && sys.RegistriesDirPath != "" {
95 return sys.RegistriesDirPath
96 }
97 userRegistriesDirPath := filepath.Join(homeDir, userRegistriesDir)
98 if err := fileutils.Exists(userRegistriesDirPath); err == nil {
99 return userRegistriesDirPath
100 }
101 if sys != nil && sys.RootForImplicitAbsolutePaths != "" {
102 return filepath.Join(sys.RootForImplicitAbsolutePaths, systemRegistriesDirPath)
103 }
104
105 return systemRegistriesDirPath
106}
107
108// loadAndMergeConfig loads configuration files in dirPath
109// FIXME: Probably rename to loadRegistryConfigurationForPath

Callers 2

registriesDirPathFunction · 0.85
TestRegistriesDirPathFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestRegistriesDirPathFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…