From 2afa12073cc48bd519eb3c907d0e1a69b3a88eca Mon Sep 17 00:00:00 2001 From: Clayton Coleman Date: Wed, 19 Nov 2014 22:04:05 -0500 Subject: [PATCH] Do not log an error when file does not exist --- pkg/credentialprovider/config.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/credentialprovider/config.go b/pkg/credentialprovider/config.go index f1880291872..21d4c0b08ba 100644 --- a/pkg/credentialprovider/config.go +++ b/pkg/credentialprovider/config.go @@ -22,6 +22,7 @@ import ( "fmt" "io/ioutil" "net/http" + "os" "path/filepath" "strings" @@ -53,6 +54,9 @@ func ReadDockerConfigFile() (cfg DockerConfig, err error) { absDockerConfigFileLocation, err = filepath.Abs(dockerConfigFileLocation) glog.V(2).Infof("looking for .dockercfg at %s", absDockerConfigFileLocation) contents, err := ioutil.ReadFile(absDockerConfigFileLocation) + if os.IsNotExist(err) { + return make(DockerConfig), nil + } if err != nil { glog.Errorf("while trying to read %s: %v", absDockerConfigFileLocation, err) return nil, err