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

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) ===
Closes #7308

Signed-off-by: Stéphane Graber <stgra...@ubuntu.com>
From a4f73777b23e2b56349d38e2c1a0d7cfb9e053db Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgra...@ubuntu.com>
Date: Thu, 7 May 2020 15:25:30 -0400
Subject: [PATCH] client/lxd_images: Fix backward compatibility
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Closes #7308

Signed-off-by: Stéphane Graber <stgra...@ubuntu.com>
---
 client/lxd_images.go | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/client/lxd_images.go b/client/lxd_images.go
index 453bb624c3..0203b0ebbf 100644
--- a/client/lxd_images.go
+++ b/client/lxd_images.go
@@ -326,8 +326,14 @@ func (r *ProtocolLXD) GetImageAliasType(imageType string, 
name string) (*api.Ima
                return nil, "", err
        }
 
-       if imageType != "" && alias.Type != imageType {
-               return nil, "", fmt.Errorf("Alias doesn't exist for the 
specified type")
+       if imageType != "" {
+               if alias.Type == "" {
+                       alias.Type = "container"
+               }
+
+               if alias.Type != imageType {
+                       return nil, "", fmt.Errorf("Alias doesn't exist for the 
specified type")
+               }
        }
 
        return alias, etag, nil
_______________________________________________
lxc-devel mailing list
lxc-devel@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-devel

Reply via email to