[lxc-devel] [lxd/master] lxd/storage: Expand local config

stgraber on Github lxc-bot at linuxcontainers.org
Wed Nov 11 00:49:45 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/20201110/bd5ed6eb/attachment.bin>
-------------- next part --------------
From 2808a54b6644beffd7b80b0601f14f3ce3927f59 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber at ubuntu.com>
Date: Tue, 10 Nov 2020 19:46:10 -0500
Subject: [PATCH] lxd/storage: Expand local config
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Closes #8119

Signed-off-by: Stéphane Graber <stgraber at ubuntu.com>
---
 lxd/storage_pools_utils.go | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/lxd/storage_pools_utils.go b/lxd/storage_pools_utils.go
index c5a1234372..57cc08b74f 100644
--- a/lxd/storage_pools_utils.go
+++ b/lxd/storage_pools_utils.go
@@ -104,6 +104,13 @@ func storagePoolCreateLocal(state *state.State, id int64, req api.StoragePoolsPo
 	var updatedReq api.StoragePoolsPost
 	shared.DeepCopy(&req, &updatedReq)
 
+	// Fill in the defaults.
+	err := storagePoolFillDefault(updatedReq.Name, updatedReq.Driver, updatedReq.Config)
+	if err != nil {
+		return nil, err
+	}
+
+	// Create the pool.
 	pool, err := storagePools.CreatePool(state, id, &updatedReq, isNotification, nil)
 	if err != nil {
 		return nil, err


More information about the lxc-devel mailing list