[lxc-devel] [lxd/master] Don't update images at all if interval is 0

stgraber on Github lxc-bot at linuxcontainers.org
Sat Nov 5 15:28:48 UTC 2016


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/20161105/0aab546c/attachment.bin>
-------------- next part --------------
From c9f702dbf559cea367038c2cf512ccc152f9ed3c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber at ubuntu.com>
Date: Sat, 5 Nov 2016 09:28:21 -0600
Subject: [PATCH] Don't update images at all if interval is 0
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/daemon.go | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/lxd/daemon.go b/lxd/daemon.go
index 63d694f..f0debc8 100644
--- a/lxd/daemon.go
+++ b/lxd/daemon.go
@@ -1069,8 +1069,13 @@ func (d *Daemon) Ready() error {
 	/* Auto-update images */
 	d.resetAutoUpdateChan = make(chan bool)
 	go func() {
-		autoUpdateImages(d)
+		// Initial image sync
+		interval := daemonConfig["images.auto_update_interval"].GetInt64()
+		if interval > 0 {
+			autoUpdateImages(d)
+		}
 
+		// Background image sync
 		for {
 			interval := daemonConfig["images.auto_update_interval"].GetInt64()
 			if interval > 0 {


More information about the lxc-devel mailing list