From 16da70c2494965792b2a3f19a87f685f1f64c79e Mon Sep 17 00:00:00 2001 From: Claudiu Belu Date: Sat, 25 May 2019 12:52:32 -0700 Subject: [PATCH] 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 --- pkg/credentialprovider/config.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/credentialprovider/config.go b/pkg/credentialprovider/config.go index a877658667..729483a291 100644 --- a/pkg/credentialprovider/config.go +++ b/pkg/credentialprovider/config.go @@ -60,7 +60,7 @@ var ( preferredPathLock sync.Mutex preferredPath = "" workingDirPath = "" - homeDirPath = os.Getenv("HOME") + homeDirPath, _ = os.UserHomeDir() rootDirPath = "/" homeJsonDirPath = filepath.Join(homeDirPath, ".docker") rootJsonDirPath = filepath.Join(rootDirPath, ".docker")