[lxc-devel] [lxd/master] lxd/containers: Don't drop the description

stgraber on Github lxc-bot at linuxcontainers.org
Mon Jan 8 07:17:02 UTC 2018


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 370 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20180108/f2635363/attachment.bin>
-------------- next part --------------
From 8a888cb9d2ff3b9f0ab1c604d410585c3f90d4ea Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber at ubuntu.com>
Date: Mon, 8 Jan 2018 01:33:32 -0500
Subject: [PATCH] lxd/containers: Don't drop the description
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Closes #4143

Signed-off-by: Stéphane Graber <stgraber at ubuntu.com>
---
 lxd/container_lxc.go  | 2 ++
 lxd/patches.go        | 1 +
 lxd/profiles_utils.go | 4 +++-
 3 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/lxd/container_lxc.go b/lxd/container_lxc.go
index e4557ca1c..687363d6b 100644
--- a/lxd/container_lxc.go
+++ b/lxd/container_lxc.go
@@ -2967,6 +2967,7 @@ func (c *containerLXC) Restore(sourceContainer container, stateful bool) error {
 		Devices:      sourceContainer.LocalDevices(),
 		Ephemeral:    sourceContainer.IsEphemeral(),
 		Profiles:     sourceContainer.Profiles(),
+		Description:  sourceContainer.Description(),
 	}
 
 	err = c.Update(args, false)
@@ -3312,6 +3313,7 @@ func (c *containerLXC) ConfigKeySet(key string, value string) error {
 		Devices:      c.localDevices,
 		Ephemeral:    c.ephemeral,
 		Profiles:     c.profiles,
+		Description:  c.description,
 	}
 
 	return c.Update(args, false)
diff --git a/lxd/patches.go b/lxd/patches.go
index 187b9c038..79367d5a3 100644
--- a/lxd/patches.go
+++ b/lxd/patches.go
@@ -1777,6 +1777,7 @@ func updatePoolPropertyForAllObjects(d *Daemon, poolName string, allcontainers [
 			LastUsedDate: c.LastUsedDate(),
 			Name:         c.Name(),
 			Profiles:     c.Profiles(),
+			Description:  c.Description(),
 		}
 
 		if c.IsSnapshot() {
diff --git a/lxd/profiles_utils.go b/lxd/profiles_utils.go
index 2a36f24d0..9d0c3e0d4 100644
--- a/lxd/profiles_utils.go
+++ b/lxd/profiles_utils.go
@@ -114,7 +114,9 @@ func doProfileUpdate(d *Daemon, name string, id int64, profile *api.Profile, req
 			Ephemeral:    c.IsEphemeral(),
 			Config:       c.LocalConfig(),
 			Devices:      c.LocalDevices(),
-			Profiles:     c.Profiles()}, true)
+			Profiles:     c.Profiles(),
+			Description:  c.Description(),
+		}, true)
 
 		if err != nil {
 			failures[c.Name()] = err


More information about the lxc-devel mailing list