[lxc-devel] [lxd/master] lxd/containers: Fix missing project in args

stgraber on Github lxc-bot at linuxcontainers.org
Tue Nov 6 20:10:06 UTC 2018


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/20181106/bc7ab71b/attachment.bin>
-------------- next part --------------
From 3563dcd2a3d7f58be4b95342a92078a6a878ef97 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber at ubuntu.com>
Date: Tue, 6 Nov 2018 15:09:45 -0500
Subject: [PATCH] lxd/containers: Fix missing project in args
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>
---
 lxd/container_lxc.go         | 3 ++-
 lxd/container_patch.go       | 1 +
 lxd/container_put.go         | 1 +
 lxd/container_state.go       | 1 +
 lxd/storage_volumes_utils.go | 1 +
 5 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/lxd/container_lxc.go b/lxd/container_lxc.go
index 57e6d57da0..0bee5af638 100644
--- a/lxd/container_lxc.go
+++ b/lxd/container_lxc.go
@@ -3292,6 +3292,7 @@ func (c *containerLXC) Restore(sourceContainer container, stateful bool) error {
 		Devices:      sourceContainer.LocalDevices(),
 		Ephemeral:    sourceContainer.IsEphemeral(),
 		Profiles:     sourceContainer.Profiles(),
+		Project:      sourceContainer.Project(),
 	}
 
 	err = c.Update(args, false)
@@ -3726,13 +3727,13 @@ func (c *containerLXC) ConfigKeySet(key string, value string) error {
 	c.localConfig[key] = value
 
 	args := db.ContainerArgs{
-		Project:      c.project,
 		Architecture: c.architecture,
 		Config:       c.localConfig,
 		Description:  c.description,
 		Devices:      c.localDevices,
 		Ephemeral:    c.ephemeral,
 		Profiles:     c.profiles,
+		Project:      c.project,
 	}
 
 	err := c.Update(args, false)
diff --git a/lxd/container_patch.go b/lxd/container_patch.go
index ff24b9d9aa..cb3a28e12c 100644
--- a/lxd/container_patch.go
+++ b/lxd/container_patch.go
@@ -120,6 +120,7 @@ func containerPatch(d *Daemon, r *http.Request) Response {
 		Devices:      req.Devices,
 		Ephemeral:    req.Ephemeral,
 		Profiles:     req.Profiles,
+		Project:      project,
 	}
 
 	err = c.Update(args, false)
diff --git a/lxd/container_put.go b/lxd/container_put.go
index 0608bee6c0..90a12b7d5e 100644
--- a/lxd/container_put.go
+++ b/lxd/container_put.go
@@ -68,6 +68,7 @@ func containerPut(d *Daemon, r *http.Request) Response {
 				Devices:      configRaw.Devices,
 				Ephemeral:    configRaw.Ephemeral,
 				Profiles:     configRaw.Profiles,
+				Project:      project,
 			}
 
 			// FIXME: should set to true when not migrating
diff --git a/lxd/container_state.go b/lxd/container_state.go
index 7b035b9e3f..77ced1182b 100644
--- a/lxd/container_state.go
+++ b/lxd/container_state.go
@@ -136,6 +136,7 @@ func containerStatePut(d *Daemon, r *http.Request) Response {
 					Devices:      c.LocalDevices(),
 					Ephemeral:    false,
 					Profiles:     c.Profiles(),
+					Project:      c.Project(),
 				}
 
 				err := c.Update(args, false)
diff --git a/lxd/storage_volumes_utils.go b/lxd/storage_volumes_utils.go
index a4effa92a0..b9c6253b6b 100644
--- a/lxd/storage_volumes_utils.go
+++ b/lxd/storage_volumes_utils.go
@@ -310,6 +310,7 @@ func storagePoolVolumeUpdateUsers(d *Daemon, oldPoolName string,
 			Devices:      devices,
 			Ephemeral:    c.IsEphemeral(),
 			Profiles:     c.Profiles(),
+			Project:      c.Project(),
 		}
 
 		err = c.Update(args, false)


More information about the lxc-devel mailing list