handle kernel version error in version api
Signed-off-by: allencloud <allen.sun@daocloud.io>
This commit is contained in:
parent
04c7d94c71
commit
73046cb8d8
1 changed files with 6 additions and 2 deletions
|
@ -141,9 +141,13 @@ func (daemon *Daemon) SystemVersion() types.Version {
|
|||
Experimental: utils.ExperimentalBuild(),
|
||||
}
|
||||
|
||||
if kernelVersion, err := kernel.GetKernelVersion(); err == nil {
|
||||
v.KernelVersion = kernelVersion.String()
|
||||
kernelVersion := "<unknown>"
|
||||
if kv, err := kernel.GetKernelVersion(); err != nil {
|
||||
logrus.Warnf("Could not get kernel version: %v", err)
|
||||
} else {
|
||||
kernelVersion = kv.String()
|
||||
}
|
||||
v.KernelVersion = kernelVersion
|
||||
|
||||
return v
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue