MCPcopy Index your code
hub / github.com/docker/docker-agent / GetConfigDir

Function GetConfigDir

pkg/paths/paths.go:96–104  ·  view source on GitHub ↗

GetConfigDir returns the user's config directory for docker agent. If an override has been set via [SetConfigDir] it is returned instead. If the home directory cannot be determined, it falls back to a directory under the system temporary directory. This is a best-effort fallback and not intended t

()

Source from the content-addressed store, hash-verified

94// under the system temporary directory. This is a best-effort fallback and
95// not intended to be a security boundary.
96func GetConfigDir() string {
97 return configDirOverride.get(func() string {
98 homeDir, err := os.UserHomeDir()
99 if err != nil {
100 return filepath.Clean(filepath.Join(os.TempDir(), ".cagent-config"))
101 }
102 return filepath.Clean(filepath.Join(homeDir, ".config", "cagent"))
103 })
104}
105
106// GetDataDir returns the user's data directory for docker agent (caches, content, logs).
107//

Callers 9

tokenstore.goFile · 0.92
TestSetRootFunction · 0.92
statePathFunction · 0.92
writeStatusFunction · 0.92
PathFunction · 0.92
legacyAliasesPathFunction · 0.92
NewDefaultProviderFunction · 0.92
runInSandboxFunction · 0.92
isFirstRunFunction · 0.92

Calls 1

getMethod · 0.45

Tested by 1

TestSetRootFunction · 0.74