[lxc-devel] [distrobuilder/master] sources: Fix Ubuntu variant check

monstermunchkin on Github lxc-bot at linuxcontainers.org
Mon Aug 12 13:17:34 UTC 2019


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 364 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20190812/d34c49eb/attachment.bin>
-------------- next part --------------
From 90f8bc592e15fb5702d9e61c379ae053a72ff79c Mon Sep 17 00:00:00 2001
From: Thomas Hipp <thomas.hipp at canonical.com>
Date: Mon, 12 Aug 2019 15:07:55 +0200
Subject: [PATCH] sources: Fix Ubuntu variant check

Signed-off-by: Thomas Hipp <thomas.hipp at canonical.com>
---
 sources/ubuntu-http.go | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/sources/ubuntu-http.go b/sources/ubuntu-http.go
index 40bd6cd..38c2e9c 100644
--- a/sources/ubuntu-http.go
+++ b/sources/ubuntu-http.go
@@ -39,15 +39,14 @@ func (s *UbuntuHTTP) Run(definition shared.Definition, rootfsDir string) error {
 		return err
 	}
 
-	switch strings.ToLower(definition.Image.Variant) {
-	case "default":
-		return s.runDefaultVariant(definition, rootfsDir)
+	switch strings.ToLower(definition.Source.Variant) {
 	case "core":
 		return s.runCoreVariant(definition, rootfsDir)
-
+	default:
+		return s.runDefaultVariant(definition, rootfsDir)
 	}
 
-	return fmt.Errorf("Unknown Ubuntu variant: %s", definition.Image.Variant)
+	return fmt.Errorf("Unknown Ubuntu variant: %s", definition.Source.Variant)
 }
 
 func (s *UbuntuHTTP) runDefaultVariant(definition shared.Definition, rootfsDir string) error {


More information about the lxc-devel mailing list