The following pull request was submitted through Github.
It can be accessed and reviewed at: https://github.com/lxc/lxd/pull/3183

This e-mail was sent by the LXC bot, direct replies will not reach the author
unless they happen to be subscribed to this list.

=== Description (from pull-request) ===
Without this we'd run the risk of changing idmap values and then doing
an action like a publish with an incorect map.

Signed-off-by: Stéphane Graber <[email protected]>
From 73a2651e21b0fe87f5971508354e3c6049abea36 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <[email protected]>
Date: Tue, 18 Apr 2017 02:04:32 -0400
Subject: [PATCH] Properly invalidate the idmap cache
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Without this we'd run the risk of changing idmap values and then doing
an action like a publish with an incorect map.

Signed-off-by: Stéphane Graber <[email protected]>
---
 lxd/container_lxc.go | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/lxd/container_lxc.go b/lxd/container_lxc.go
index c5e7c0e..52dfbec 100644
--- a/lxd/container_lxc.go
+++ b/lxd/container_lxc.go
@@ -316,6 +316,9 @@ func containerLXCCreate(d *Daemon, args containerArgs) 
(container, error) {
                return nil, err
        }
 
+       // Invalid idmap cache
+       c.idmapset = nil
+
        // Set last_state to the map we have on disk
        if c.localConfig["volatile.last_state.idmap"] == "" {
                err = c.ConfigKeySet("volatile.last_state.idmap", jsonIdmap)
@@ -3281,6 +3284,9 @@ func (c *containerLXC) Update(args containerArgs, 
userRequested bool) error {
                }
                c.localConfig["volatile.idmap.next"] = jsonIdmap
                c.localConfig["volatile.idmap.base"] = fmt.Sprintf("%v", base)
+
+               // Invalid idmap cache
+               c.idmapset = nil
        }
 
        // Retrieve old root disk devices.
_______________________________________________
lxc-devel mailing list
[email protected]
http://lists.linuxcontainers.org/listinfo/lxc-devel

Reply via email to