[lxc-devel] [lxd/master] lxd: Send metadata in CreateImage error importing image

joelhockey on Github lxc-bot at linuxcontainers.org
Wed Jan 30 06:20:22 UTC 2019


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 486 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20190129/5bd45b44/attachment.bin>
-------------- next part --------------
From 0ed73c8a6fd08c2a83b2a58abbde404416c4b32b Mon Sep 17 00:00:00 2001
From: Joel Hockey <joelhockey at chromium.org>
Date: Tue, 29 Jan 2019 22:18:09 -0800
Subject: [PATCH] lxd: Send metadata in CreateImage error importing image

When importing a packed image, send 'fingerprint' and 'size'
in metadata when an error occurs because the image already
exists.

Signed-off-by: Joel Hockey <joelhockey at chromium.org>
---
 lxd/images.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lxd/images.go b/lxd/images.go
index 59dadf433a..8c4ecd0683 100644
--- a/lxd/images.go
+++ b/lxd/images.go
@@ -580,7 +580,7 @@ func getImgPostInfo(d *Daemon, r *http.Request, builddir string, project string,
 				return nil, err
 			}
 		} else {
-			return nil, fmt.Errorf("Image with same fingerprint already exists")
+			return &info, fmt.Errorf("Image with same fingerprint already exists")
 		}
 	} else {
 		// Create the database entry


More information about the lxc-devel mailing list