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

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) ===

From e600777f0fa8f8a3ab4742da1490961e55d8f316 Mon Sep 17 00:00:00 2001
From: Thomas Parrott <thomas.parr...@canonical.com>
Date: Thu, 10 Dec 2020 09:53:01 +0000
Subject: [PATCH 1/3] lxd/db/storage/pools: Comment wrapping

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

diff --git a/lxd/db/storage_pools.go b/lxd/db/storage_pools.go
index 378e6547c5..b38d7a62f7 100644
--- a/lxd/db/storage_pools.go
+++ b/lxd/db/storage_pools.go
@@ -946,8 +946,7 @@ func (c *Cluster) FillMissingStoragePoolDriver() error {
        return err
 }
 
-// StoragePoolNodeConfigKeys lists all storage pool config keys which are
-// node-specific.
+// StoragePoolNodeConfigKeys lists all storage pool config keys which are 
node-specific.
 var StoragePoolNodeConfigKeys = []string{
        "size",
        "source",

From ecd88221bd7a55a4c6e8b1286714e4309744dbef Mon Sep 17 00:00:00 2001
From: Thomas Parrott <thomas.parr...@canonical.com>
Date: Thu, 10 Dec 2020 09:53:15 +0000
Subject: [PATCH 2/3] lxd/storage/backend/lxd: Prevent modification of source
 field on non-pending nodes

Signed-off-by: Thomas Parrott <thomas.parr...@canonical.com>
---
 lxd/storage/backend_lxd.go | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/lxd/storage/backend_lxd.go b/lxd/storage/backend_lxd.go
index 184c6e8d6a..048d6728bd 100644
--- a/lxd/storage/backend_lxd.go
+++ b/lxd/storage/backend_lxd.go
@@ -223,6 +223,12 @@ func (b *lxdBackend) Update(clientType request.ClientType, 
newDesc string, newCo
        // Diff the configurations.
        changedConfig, userOnly := b.detectChangedConfig(b.db.Config, newConfig)
 
+       // Check if the pool source is being changed that the local state is 
still pending, otherwise prevent it.
+       _, sourceChanged := changedConfig["source"]
+       if sourceChanged && b.LocalStatus() != api.StoragePoolStatusPending {
+               return fmt.Errorf("Pool source cannot be changed when not in 
pending state")
+       }
+
        // Apply changes to local node if not pending and non-user config 
changed.
        if len(changedConfig) != 0 && b.LocalStatus() != 
api.StoragePoolStatusPending && !userOnly {
                err = b.driver.Update(changedConfig)

From 6404936c1516ebfc65614fd976ee2acaec2a4711 Mon Sep 17 00:00:00 2001
From: Thomas Parrott <thomas.parr...@canonical.com>
Date: Thu, 10 Dec 2020 09:53:35 +0000
Subject: [PATCH 3/3] lxd/storage/drivers/driver/lvm: Comment typo

Signed-off-by: Thomas Parrott <thomas.parr...@canonical.com>
---
 lxd/storage/drivers/driver_lvm.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lxd/storage/drivers/driver_lvm.go 
b/lxd/storage/drivers/driver_lvm.go
index 8654f0053d..a6f375a9dc 100644
--- a/lxd/storage/drivers/driver_lvm.go
+++ b/lxd/storage/drivers/driver_lvm.go
@@ -356,7 +356,7 @@ func (d *lvm) Delete(op *operations.Operation) error {
                                // Thin pool exists.
                                if err == nil {
                                        // If thin pool is empty and the total 
VG volume count is 1 (our thin pool
-                                       // volume) then just remote the entire 
volume group.
+                                       // volume) then just remove the entire 
volume group.
                                        if thinVolCount == 0 && lvCount == 1 {
                                                removeVg = true
                                        } else if thinVolCount == 0 && lvCount 
> 1 {
_______________________________________________
lxc-devel mailing list
lxc-devel@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-devel

Reply via email to