Commit 16da70c2 authored by Claudiu Belu's avatar Claudiu Belu

credentialprovider: Sets homeDirPath to os.UserHomeDir()

Currently, the credential provider will look in the path set in the $HOME env variable, but that environment does not exist on Windows, but $HOMEPATH does. Because of this, if credentials are set in ~/.docker on Windows, they will not be used by kubelet when pulling images. The function os.UserHomeDir can solve this problem [1]. [1] https://golang.org/pkg/os/#UserHomeDir
parent 44a3bf47
...@@ -60,7 +60,7 @@ var ( ...@@ -60,7 +60,7 @@ var (
preferredPathLock sync.Mutex preferredPathLock sync.Mutex
preferredPath = "" preferredPath = ""
workingDirPath = "" workingDirPath = ""
homeDirPath = os.Getenv("HOME") homeDirPath, _ = os.UserHomeDir()
rootDirPath = "/" rootDirPath = "/"
homeJsonDirPath = filepath.Join(homeDirPath, ".docker") homeJsonDirPath = filepath.Join(homeDirPath, ".docker")
rootJsonDirPath = filepath.Join(rootDirPath, ".docker") rootJsonDirPath = filepath.Join(rootDirPath, ".docker")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment