mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-29 14:37:00 +00:00
Merge pull request #2488 from smarterclayton/remove_chatty_error
Do not log an error when file does not exist
This commit is contained in:
commit
d6f3caeb94
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user