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
This commit is contained in:
@@ -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")
|
||||||
|
|||||||
Reference in New Issue
Block a user