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:
@@ -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
|
||||
}
|
||||
|
Reference in New Issue
Block a user