[lxc-devel] [lxd/master] lxd/init: Don't offer dir as a remote backend

stgraber on Github lxc-bot at linuxcontainers.org
Tue Mar 17 02:00:37 UTC 2020


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/20200316/edf72d31/attachment.bin>
-------------- next part --------------
From 5799bff7a7f7106250d89543ea7e85308e20b0df Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber at ubuntu.com>
Date: Mon, 16 Mar 2020 21:59:32 -0400
Subject: [PATCH] lxd/init: Don't offer dir as a remote backend
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/main_init_interactive.go | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/lxd/main_init_interactive.go b/lxd/main_init_interactive.go
index be1a28fa1c..171e91ae72 100644
--- a/lxd/main_init_interactive.go
+++ b/lxd/main_init_interactive.go
@@ -475,8 +475,13 @@ func (c *cmdInit) askStoragePool(config *cmdInitData, d lxd.InstanceServer, pool
 
 		// Storage backend
 		if len(availableBackends) > 1 {
+			defaultBackend := defaultStorage
+			if poolType == "remote" {
+				defaultBackend = "ceph"
+			}
+
 			pool.Driver = cli.AskChoice(
-				fmt.Sprintf("Name of the storage backend to use (%s) [default=%s]: ", strings.Join(availableBackends, ", "), defaultStorage), availableBackends, defaultStorage)
+				fmt.Sprintf("Name of the storage backend to use (%s) [default=%s]: ", strings.Join(availableBackends, ", "), defaultBackend), availableBackends, defaultBackend)
 		} else {
 			pool.Driver = availableBackends[0]
 		}


More information about the lxc-devel mailing list