[lxc-devel] [lxd/master] lxc/copy: Really always strip volatile.last_state.power

stgraber on Github lxc-bot at linuxcontainers.org
Fri Aug 16 16:34:19 UTC 2019


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/20190816/57253f62/attachment.bin>
-------------- next part --------------
From 663addee10bf92440a23711c80045cbadde84d9f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber at ubuntu.com>
Date: Fri, 16 Aug 2019 12:34:04 -0400
Subject: [PATCH] lxc/copy: Really always strip volatile.last_state.power
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>
---
 lxc/copy.go | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/lxc/copy.go b/lxc/copy.go
index da97460c90..ae3c2ddba9 100644
--- a/lxc/copy.go
+++ b/lxc/copy.go
@@ -331,6 +331,11 @@ func (c *cmdCopy) copyContainer(conf *config.Config, sourceResource string,
 			}
 		}
 
+		if entry.Config != nil {
+			// Strip the last_state.power key in all cases
+			delete(entry.Config, "volatile.last_state.power")
+		}
+
 		// Do the actual copy
 		if c.flagTarget != "" {
 			dest = dest.UseTarget(c.flagTarget)


More information about the lxc-devel mailing list