The following pull request was submitted through Github.
It can be accessed and reviewed at: https://github.com/lxc/lxd/pull/6698

This e-mail was sent by the LXC bot, direct replies will not reach the author
unless they happen to be subscribed to this list.

=== Description (from pull-request) ===
This allows storage pools that have *all* volumes in a non-default project to be deleted.

Note: This still does not allow storage pools that have a mixture of volumes from different projects to be deleted.

Signed-off-by: Thomas Parrott <thomas.parr...@canonical.com>
From 36ca886d7bb821ad1b2c6aa2a7fd7311fbd1d077 Mon Sep 17 00:00:00 2001
From: Thomas Parrott <thomas.parr...@canonical.com>
Date: Mon, 13 Jan 2020 13:47:15 +0000
Subject: [PATCH] lxd/storage/pools: Support non-default project in
 storagePoolDelete

This allows storage pools that have *all* volumes in a non-default project to 
be deleted.

Note: This still does not allow storage pools that have a mixture of volumes 
from different projects to be deleted.

Signed-off-by: Thomas Parrott <thomas.parr...@canonical.com>
---
 lxd/storage_pools.go | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/lxd/storage_pools.go b/lxd/storage_pools.go
index 472746dc4c..5249d95ad8 100644
--- a/lxd/storage_pools.go
+++ b/lxd/storage_pools.go
@@ -574,12 +574,13 @@ func storagePoolDelete(d *Daemon, r *http.Request) 
response.Response {
                // Only delete images if locally stored or running on initial 
member.
                if !isClusterNotification(r) || !pool.Driver().Info().Remote {
                        for _, volume := range volumeNames {
-                               _, imgInfo, err := 
d.cluster.ImageGet("default", volume, false, false)
+                               _, imgInfo, err := 
d.cluster.ImageGet(projectParam(r), volume, false, false)
                                if err != nil {
                                        return response.InternalError(err)
                                }
 
                                err = doDeleteImageFromPool(d.State(), 
imgInfo.Fingerprint, poolName)
+
                                if err != nil {
                                        return response.InternalError(err)
                                }
@@ -613,7 +614,7 @@ func storagePoolDelete(d *Daemon, r *http.Request) 
response.Response {
                }
 
                for _, volume := range volumeNames {
-                       _, imgInfo, err := d.cluster.ImageGet("default", 
volume, false, false)
+                       _, imgInfo, err := d.cluster.ImageGet(projectParam(r), 
volume, false, false)
                        if err != nil {
                                return response.InternalError(err)
                        }
_______________________________________________
lxc-devel mailing list
lxc-devel@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-devel

Reply via email to