[lxc-devel] [lxd/master] version: Only include kernel version, not build id

stgraber on Github lxc-bot at linuxcontainers.org
Sun Sep 24 02:29:45 UTC 2017


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 354 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20170924/214eaf37/attachment.bin>
-------------- next part --------------
From 1d52364d269e0d8a7702b8bbe5817e9361feda2c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber at ubuntu.com>
Date: Sat, 23 Sep 2017 22:28:49 -0400
Subject: [PATCH] version: Only include kernel version, not build id
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Stéphane Graber <stgraber at ubuntu.com>
---
 shared/version/platform_linux.go | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/shared/version/platform_linux.go b/shared/version/platform_linux.go
index 55deeadcd..1be9b3422 100644
--- a/shared/version/platform_linux.go
+++ b/shared/version/platform_linux.go
@@ -3,6 +3,8 @@
 package version
 
 import (
+	"strings"
+
 	"github.com/lxc/lxd/shared"
 	"github.com/lxc/lxd/shared/osarch"
 )
@@ -13,7 +15,7 @@ func getPlatformVersionStrings() []string {
 	// add kernel version
 	uname, err := shared.Uname()
 	if err == nil {
-		versions = append(versions, uname.Release)
+		versions = append(versions, strings.Split(uname.Release, "-")[0])
 	}
 
 	// add distribution info


More information about the lxc-devel mailing list