[lxc-devel] [lxd/master] lxc/image: Fix rootfs file handling on snap

stgraber on Github lxc-bot at linuxcontainers.org
Mon Nov 19 02:34:39 UTC 2018


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/20181119/a7271218/attachment.bin>
-------------- next part --------------
From c056f36e26bac996414dd6bd8a3b89ccc548650a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber at ubuntu.com>
Date: Sun, 18 Nov 2018 21:34:10 -0500
Subject: [PATCH] lxc/image: Fix rootfs file handling on snap
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Closes #5286

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

diff --git a/lxc/image.go b/lxc/image.go
index 9a6825a381..203b8a897f 100644
--- a/lxc/image.go
+++ b/lxc/image.go
@@ -656,6 +656,10 @@ func (c *cmdImageImport) Run(cmd *cobra.Command, args []string) error {
 		imageFile = shared.HostPath(filepath.Clean(imageFile))
 	}
 
+	if rootfsFile != "" && shared.PathExists(shared.HostPath(filepath.Clean(rootfsFile))) {
+		rootfsFile = shared.HostPath(filepath.Clean(rootfsFile))
+	}
+
 	d, err := conf.GetContainerServer(remote)
 	if err != nil {
 		return err


More information about the lxc-devel mailing list