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

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) ===
This fixes an issue where the --vm flag would be ignored if running
build-lxd.

Signed-off-by: Thomas Hipp <thomas.h...@canonical.com>
From ef2260f5cfb0ac09a263633d896d3776f2113c87 Mon Sep 17 00:00:00 2001
From: Thomas Hipp <thomas.h...@canonical.com>
Date: Mon, 2 Mar 2020 18:21:59 +0100
Subject: [PATCH] main: Fix build-lxd for VMs

This fixes an issue where the --vm flag would be ignored if running
build-lxd.

Signed-off-by: Thomas Hipp <thomas.h...@canonical.com>
---
 distrobuilder/main.go     | 1 +
 distrobuilder/main_lxd.go | 4 ----
 2 files changed, 1 insertion(+), 4 deletions(-)

diff --git a/distrobuilder/main.go b/distrobuilder/main.go
index 2d4c542..6fba06a 100644
--- a/distrobuilder/main.go
+++ b/distrobuilder/main.go
@@ -275,6 +275,7 @@ func (c *cmdGlobal) preRunBuild(cmd *cobra.Command, args 
[]string) error {
 
                if ok {
                        imageTargets |= shared.ImageTargetVM
+                       c.definition.Targets.Type = "vm"
                } else {
                        imageTargets |= shared.ImageTargetContainer
                }
diff --git a/distrobuilder/main_lxd.go b/distrobuilder/main_lxd.go
index b2f51c4..2fa2648 100644
--- a/distrobuilder/main_lxd.go
+++ b/distrobuilder/main_lxd.go
@@ -53,10 +53,6 @@ func (c *cmdLXD) commandBuild() *cobra.Command {
                        }
                        defer cleanup()
 
-                       if c.flagVM {
-                               c.global.definition.Targets.Type = "vm"
-                       }
-
                        return c.run(cmd, args, overlayDir)
                },
        }
_______________________________________________
lxc-devel mailing list
lxc-devel@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-devel

Reply via email to