Skip to content

Commit

Permalink
Don't rely on the returned value when there's an error
Browse files Browse the repository at this point in the history
  • Loading branch information
ronnielai committed Jun 24, 2016
1 parent dbff294 commit 7ba1f7e
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions manager/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,13 +137,19 @@ func New(memoryCache *memory.InMemoryCache, sysfs sysfs.SysFs, maxHousekeepingIn
}
glog.Infof("cAdvisor running in container: %q", selfContainer)

dockerStatus, err := docker.Status()
if err != nil {
var (
dockerStatus info.DockerStatus
rktPath string
)
if tempDockerStatus, err := docker.Status(); err != nil {
glog.Warningf("Unable to connect to Docker: %v", err)
} else {
dockerStatus = tempDockerStatus
}
rktPath, err := rkt.RktPath()
if err != nil {
if tmpRktPath, err := rkt.RktPath(); err != nil {
glog.Warningf("unable to connect to Rkt api service: %v", err)
} else {
rktPath = tmpRktPath
}

context := fs.Context{
Expand Down

0 comments on commit 7ba1f7e

Please sign in to comment.