1
0
mirror of https://github.com/rancher/os.git synced 2025-09-01 23:04:41 +00:00

get the kernel version for the banner

Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>
This commit is contained in:
Sven Dowideit
2017-07-13 23:06:57 +10:00
parent 180fe241d8
commit d859052453
4 changed files with 22 additions and 7 deletions

View File

@@ -2,7 +2,6 @@ package docker
import (
"fmt"
"io/ioutil"
"strings"
composeConfig "github.com/docker/libcompose/config"
@@ -43,11 +42,9 @@ func environmentFromCloudConfig(cfg *config.CloudConfig) map[string]string {
environment["no_proxy"] = cfg.Rancher.Network.NoProxy
environment["NO_PROXY"] = cfg.Rancher.Network.NoProxy
}
b, err := ioutil.ReadFile("/proc/version")
if err == nil {
elem := strings.Split(string(b), " ")
environment["KERNEL_VERSION"] = elem[2]
log.Debugf("Using /proc/version to set rancher.environment.KERNEL_VERSION = %s", elem[2])
if v := config.GetKernelVersion(); v != "" {
environment["KERNEL_VERSION"] = v
log.Debugf("Using /proc/version to set rancher.environment.KERNEL_VERSION = %s", v)
}
return environment
}