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

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) ===
Resolves #4.

Signed-off-by: Thomas Hipp <thomas.h...@canonical.com>
From b64123b426b7ab6b59a77f709940de43dee40b23 Mon Sep 17 00:00:00 2001
From: Thomas Hipp <thomas.h...@canonical.com>
Date: Wed, 14 Feb 2018 10:35:03 +0100
Subject: [PATCH] shared: do not require release field

Resolves #4.

Signed-off-by: Thomas Hipp <thomas.h...@canonical.com>
---
 shared/definition.go      |  6 +-----
 shared/definition_test.go | 10 ----------
 2 files changed, 1 insertion(+), 15 deletions(-)

diff --git a/shared/definition.go b/shared/definition.go
index d2f4c14..ecf5029 100644
--- a/shared/definition.go
+++ b/shared/definition.go
@@ -22,7 +22,7 @@ type DefinitionPackages struct {
 type DefinitionImage struct {
        Description  string `yaml:"description"`
        Distribution string `yaml:"distribution"`
-       Release      string `yaml:"release"`
+       Release      string `yaml:"release,omitempty"`
        Arch         string `yaml:"arch,omitempty"`
        Expiry       string `yaml:"expiry,omitempty"`
        Variant      string `yaml:"variant,omitempty"`
@@ -99,10 +99,6 @@ func ValidateDefinition(def Definition) error {
                return errors.New("image.distribution may not be empty")
        }
 
-       if strings.TrimSpace(def.Image.Release) == "" {
-               return errors.New("image.release may not be empty")
-       }
-
        validDownloaders := []string{
                "alpinelinux-http",
                "archlinux-http",
diff --git a/shared/definition_test.go b/shared/definition_test.go
index e2e64f6..63332bf 100644
--- a/shared/definition_test.go
+++ b/shared/definition_test.go
@@ -52,16 +52,6 @@ func TestValidateDefinition(t *testing.T) {
                        "image.distribution may not be empty",
                        true,
                },
-               {
-                       "empty image.release",
-                       Definition{
-                               Image: DefinitionImage{
-                                       Distribution: "ubuntu",
-                               },
-                       },
-                       "image.release may not be empty",
-                       true,
-               },
                {
                        "invalid source.downloader",
                        Definition{
_______________________________________________
lxc-devel mailing list
lxc-devel@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-devel

Reply via email to