Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
0f1455ac
Commit
0f1455ac
authored
Oct 09, 2014
by
Dawn Chen
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1687 from erictune/fix_dockercfg
Handle and log errors when reading .dockercfg
parents
5514ea8b
4e0a7273
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
2 deletions
+16
-2
config.go
pkg/kubelet/dockertools/config.go
+16
-2
No files found.
pkg/kubelet/dockertools/config.go
View file @
0f1455ac
...
...
@@ -22,6 +22,7 @@ import (
"fmt"
"io/ioutil"
"net/url"
"path/filepath"
"strings"
"github.com/fsouza/go-dockerclient"
...
...
@@ -33,8 +34,21 @@ const (
)
func
readDockerConfigFile
()
(
cfg
dockerConfig
,
err
error
)
{
contents
,
err
:=
ioutil
.
ReadFile
(
dockerConfigFileLocation
)
err
=
json
.
Unmarshal
(
contents
,
&
cfg
)
absDockerConfigFileLocation
,
err
:=
filepath
.
Abs
(
dockerConfigFileLocation
)
if
err
!=
nil
{
glog
.
Errorf
(
"while trying to canonicalize %s: %v"
,
dockerConfigFileLocation
,
err
)
}
absDockerConfigFileLocation
,
err
=
filepath
.
Abs
(
dockerConfigFileLocation
)
glog
.
V
(
2
)
.
Infof
(
"looking for .dockercfg at %s"
,
absDockerConfigFileLocation
)
contents
,
err
:=
ioutil
.
ReadFile
(
absDockerConfigFileLocation
)
if
err
!=
nil
{
glog
.
Errorf
(
"while trying to read %s: %v"
,
absDockerConfigFileLocation
,
err
)
return
nil
,
err
}
if
err
=
json
.
Unmarshal
(
contents
,
&
cfg
);
err
!=
nil
{
glog
.
Errorf
(
"while trying to parse %s: %v"
,
absDockerConfigFileLocation
,
err
)
return
nil
,
err
}
return
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment