mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
daemon/info.go: remove check for map nilness
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
This commit is contained in:
parent
a6a3c42b58
commit
8f311f4d8c
1 changed files with 1 additions and 8 deletions
|
@ -19,13 +19,6 @@ import (
|
|||
|
||||
// SystemInfo returns information about the host server the daemon is running on.
|
||||
func (daemon *Daemon) SystemInfo() (*types.Info, error) {
|
||||
images := daemon.Graph().Map()
|
||||
var imgcount int
|
||||
if images == nil {
|
||||
imgcount = 0
|
||||
} else {
|
||||
imgcount = len(images)
|
||||
}
|
||||
kernelVersion := "<unknown>"
|
||||
if kv, err := kernel.GetKernelVersion(); err == nil {
|
||||
kernelVersion = kv.String()
|
||||
|
@ -66,7 +59,7 @@ func (daemon *Daemon) SystemInfo() (*types.Info, error) {
|
|||
v := &types.Info{
|
||||
ID: daemon.ID,
|
||||
Containers: len(daemon.List()),
|
||||
Images: imgcount,
|
||||
Images: len(daemon.Graph().Map()),
|
||||
Driver: daemon.GraphDriver().String(),
|
||||
DriverStatus: daemon.GraphDriver().Status(),
|
||||
IPv4Forwarding: !sysInfo.IPv4ForwardingDisabled,
|
||||
|
|
Loading…
Add table
Reference in a new issue