The following pull request was submitted through Github. It can be accessed and reviewed at: https://github.com/lxc/lxd/pull/6609
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) === Signed-off-by: Stéphane Graber <stgra...@ubuntu.com>
From b7bb882ff3aac6f79ef94652af7fef83f6d83411 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgra...@ubuntu.com> Date: Thu, 12 Dec 2019 12:12:40 -0500 Subject: [PATCH] shared/simplestreams: Only write cache if configured MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Stéphane Graber <stgra...@ubuntu.com> --- shared/simplestreams/simplestreams.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/shared/simplestreams/simplestreams.go b/shared/simplestreams/simplestreams.go index 6f3a189542..11984de5ec 100644 --- a/shared/simplestreams/simplestreams.go +++ b/shared/simplestreams/simplestreams.go @@ -134,9 +134,11 @@ func (s *SimpleStreams) cachedDownload(path string) ([]byte, error) { } // Attempt to store in cache - cacheName := filepath.Join(s.cachePath, fileName) - os.Remove(cacheName) - ioutil.WriteFile(cacheName, body, 0644) + if s.cachePath != "" { + cacheName := filepath.Join(s.cachePath, fileName) + os.Remove(cacheName) + ioutil.WriteFile(cacheName, body, 0644) + } return body, nil }
_______________________________________________ lxc-devel mailing list lxc-devel@lists.linuxcontainers.org http://lists.linuxcontainers.org/listinfo/lxc-devel