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

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) ===
This is needed to make a proxy config change immediately effective.

Signed-off-by: Stéphane Graber <stgra...@ubuntu.com>
From 0083e9ad28c8b79e07a2d18d106e4c1de8849332 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgra...@ubuntu.com>
Date: Wed, 13 Apr 2016 18:53:08 -0400
Subject: [PATCH] Invalidate the simplestreams cache on proxy change
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

This is needed to make a proxy config change immediately effective.

Signed-off-by: Stéphane Graber <stgra...@ubuntu.com>
---
 lxd/api_1.0.go | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/lxd/api_1.0.go b/lxd/api_1.0.go
index ba653db..db3a8fb 100644
--- a/lxd/api_1.0.go
+++ b/lxd/api_1.0.go
@@ -240,7 +240,16 @@ func api10Put(d *Daemon, r *http.Request) Response {
                                return InternalError(err)
                        }
 
+                       // Update the cached proxy function
                        d.updateProxy()
+
+                       // Clear the simplestreams cache as it's tied to the 
old proxy config
+                       imageStreamCacheLock.Lock()
+                       for k, _ := range imageStreamCache {
+                               delete(imageStreamCache, k)
+                       }
+                       imageStreamCacheLock.Unlock()
+
                } else {
                        err := d.ConfigValueSet(key, value.(string))
                        if err != nil {
_______________________________________________
lxc-devel mailing list
lxc-devel@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-devel

Reply via email to