[lxc-devel] [lxd/master] lxd/cluster: Ignore CEPH custom volumes on removal

stgraber on Github lxc-bot at linuxcontainers.org
Tue Mar 17 18:42:05 UTC 2020


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/20200317/50d835b2/attachment.bin>
-------------- next part --------------
From 9e52800732921bdbb64210f20858b6e934283354 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber at ubuntu.com>
Date: Tue, 17 Mar 2020 13:53:20 -0400
Subject: [PATCH] lxd/cluster: Ignore CEPH custom volumes on removal
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Closes #6975

Signed-off-by: Stéphane Graber <stgraber at ubuntu.com>
---
 lxd/db/node.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lxd/db/node.go b/lxd/db/node.go
index d9ddfd78dd..ed80dd3313 100644
--- a/lxd/db/node.go
+++ b/lxd/db/node.go
@@ -508,7 +508,7 @@ SELECT fingerprint, node_id FROM images JOIN images_nodes ON images.id=images_no
 
 	// Check if the node has any custom volumes.
 	volumes, err := query.SelectStrings(
-		c.tx, "SELECT name FROM storage_volumes WHERE node_id=? AND type=?",
+		c.tx, "SELECT storage_volumes.name FROM storage_volumes LEFT JOIN storage_pools ON storage_volumes.storage_pool_id=storage_pools.id WHERE storage_volumes.node_id=? AND storage_volumes.type=? AND storage_pools.driver NOT IN ('ceph', 'cephfs')",
 		id, StoragePoolVolumeTypeCustom)
 	if err != nil {
 		return "", errors.Wrapf(err, "Failed to get custom volumes for node %d", id)


More information about the lxc-devel mailing list