[lxc-devel] [lxd/master] lxd/images: Fix image type during refresh

stgraber on Github lxc-bot at linuxcontainers.org
Mon Sep 30 18:30:56 UTC 2019


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 488 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20190930/f904adab/attachment.bin>
-------------- next part --------------
From 445a40afc38d1644e0e525666763c4e49a464a32 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber at ubuntu.com>
Date: Mon, 30 Sep 2019 14:28:11 -0400
Subject: [PATCH] lxd/images: Fix image type during refresh
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

The DB record of the image source does not include the image type, this
needs to be instead retrieved from the image info itself.

Signed-off-by: Stéphane Graber <stgraber at ubuntu.com>
---
 lxd/images.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lxd/images.go b/lxd/images.go
index c48c7b65dc..28ec1797a5 100644
--- a/lxd/images.go
+++ b/lxd/images.go
@@ -1085,7 +1085,7 @@ func autoUpdateImage(d *Daemon, op *operations.Operation, id int, info *api.Imag
 	// Update the image on each pool where it currently exists.
 	hash := fingerprint
 	for _, poolName := range poolNames {
-		newInfo, err := d.ImageDownload(op, source.Server, source.Protocol, source.Certificate, "", source.Alias, source.ImageType, false, true, poolName, false, project)
+		newInfo, err := d.ImageDownload(op, source.Server, source.Protocol, source.Certificate, "", source.Alias, info.Type, false, true, poolName, false, project)
 
 		if err != nil {
 			logger.Error("Failed to update the image", log.Ctx{"err": err, "fp": fingerprint})


More information about the lxc-devel mailing list