[lxc-devel] [lxd/master] lxd/init: Fix --auto with network config

stgraber on Github lxc-bot at linuxcontainers.org
Mon Apr 2 16:15:07 UTC 2018


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/20180402/ee686adc/attachment.bin>
-------------- next part --------------
From ba97cbbf80de59814604038ade9d06aaa6e64a5f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber at ubuntu.com>
Date: Mon, 2 Apr 2018 12:14:50 -0400
Subject: [PATCH] lxd/init: Fix --auto with network config
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_auto.go    | 1 +
 test/suites/init_auto.sh | 9 +++++++++
 2 files changed, 10 insertions(+)

diff --git a/lxd/main_init_auto.go b/lxd/main_init_auto.go
index 94389956b..352c511b0 100644
--- a/lxd/main_init_auto.go
+++ b/lxd/main_init_auto.go
@@ -61,6 +61,7 @@ func (c *cmdInit) RunAuto(cmd *cobra.Command, args []string, d lxd.ContainerServ
 
 	// Fill in the configuration
 	config := initData{}
+	config.Config = map[string]interface{}{}
 
 	// Network listening
 	if c.flagNetworkAddress != "" {
diff --git a/test/suites/init_auto.sh b/test/suites/init_auto.sh
index 50f487a73..a0fe791c1 100644
--- a/test/suites/init_auto.sh
+++ b/test/suites/init_auto.sh
@@ -55,4 +55,13 @@ test_init_auto() {
 
     kill_lxd "${LXD_INIT_DIR}"
   fi
+
+  # lxd init --trust-password test --network-address 127.0.0.1 --network-port LOCAL --auto
+  LXD_INIT_DIR=$(mktemp -d -p "${TEST_DIR}" XXX)
+  chmod +x "${LXD_INIT_DIR}"
+  spawn_lxd "${LXD_INIT_DIR}" false
+
+  LXD_DIR=${LXD_INIT_DIR} lxd init --trust-password test --network-address 127.0.0.1 --network-port "$(local_tcp_port)" --auto
+
+  kill_lxd "${LXD_INIT_DIR}"
 }


More information about the lxc-devel mailing list