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

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 field is useless as we can simply check source.suite.

Signed-off-by: Thomas Hipp <thomas.h...@canonical.com>
From 55f9dd3f2b7beb9359d104c47ebcaf7b93672eec Mon Sep 17 00:00:00 2001
From: Thomas Hipp <thomas.h...@canonical.com>
Date: Mon, 26 Aug 2019 14:23:48 +0200
Subject: [PATCH] shared: Remove source.ignore_release

This field is useless as we can simply check source.suite.

Signed-off-by: Thomas Hipp <thomas.h...@canonical.com>
---
 shared/definition.go      |  1 -
 shared/definition_test.go | 12 ++++++------
 sources/debootstrap.go    | 17 ++++++-----------
 3 files changed, 12 insertions(+), 18 deletions(-)

diff --git a/shared/definition.go b/shared/definition.go
index ed812cd..ceae83e 100644
--- a/shared/definition.go
+++ b/shared/definition.go
@@ -89,7 +89,6 @@ type DefinitionSource struct {
        Suite            string   `yaml:"suite,omitempty"`
        SameAs           string   `yaml:"same_as,omitempty"`
        AptSources       string   `yaml:"apt_sources,omitempty"`
-       IgnoreRelease    bool     `yaml:"ignore_release,omitempty"`
        SkipVerification bool     `yaml:"skip_verification,omitempty"`
        EarlyPackages    []string `yaml:"early_packages,omitempty"`
 }
diff --git a/shared/definition_test.go b/shared/definition_test.go
index 8d84dad..7b069f3 100644
--- a/shared/definition_test.go
+++ b/shared/definition_test.go
@@ -447,10 +447,10 @@ func TestDefinitionSetValue(t *testing.T) {
                        Release:      "artful",
                },
                Source: DefinitionSource{
-                       Downloader:    "debootstrap",
-                       URL:           "https://ubuntu.com";,
-                       Keys:          []string{"0xCODE"},
-                       IgnoreRelease: true,
+                       Downloader:       "debootstrap",
+                       URL:              "https://ubuntu.com";,
+                       Keys:             []string{"0xCODE"},
+                       SkipVerification: true,
                },
                Packages: DefinitionPackages{
                        Manager: "apt",
@@ -483,9 +483,9 @@ func TestDefinitionSetValue(t *testing.T) {
        err = d.SetValue("image", "[foo: bar]")
        require.EqualError(t, err, "Unsupported type 'struct'")
 
-       err = d.SetValue("source.ignore_release", "true")
+       err = d.SetValue("source.skip_verification", "true")
        require.NoError(t, err)
-       require.Equal(t, true, d.Source.IgnoreRelease)
+       require.Equal(t, true, d.Source.SkipVerification)
 }
 
 func TestDefinitionFilter(t *testing.T) {
diff --git a/sources/debootstrap.go b/sources/debootstrap.go
index 133236c..8e880c9 100644
--- a/sources/debootstrap.go
+++ b/sources/debootstrap.go
@@ -52,16 +52,11 @@ func (s *Debootstrap) Run(definition shared.Definition, 
rootfsDir string) error
                args = append(args, "--keyring", keyring)
        }
 
-       // If source.ignore_release is set, debootstrap will not use 
image.release
-       // but source.suite as the release. This is important for derivatives 
which
-       // don't have own sources, e.g. Linux Mint.
-       if definition.Source.IgnoreRelease {
-               // If source.suite is set, use it when calling debootstrap
-               if definition.Source.Suite != "" {
-                       args = append(args, definition.Source.Suite, rootfsDir)
-               } else {
-                       args = append(args, definition.Image.Release, rootfsDir)
-               }
+       // If source.suite is set, debootstrap will use this instead of
+       // image.release as its first positional argument (SUITE). This is 
important
+       // for derivatives which don't have their own sources, e.g. Linux Mint.
+       if definition.Source.Suite != "" {
+               args = append(args, definition.Source.Suite, rootfsDir)
        } else {
                args = append(args, definition.Image.Release, rootfsDir)
        }
@@ -71,7 +66,7 @@ func (s *Debootstrap) Run(definition shared.Definition, 
rootfsDir string) error
        }
 
        // If definition.Source.SameAs is set, create a symlink in 
/usr/share/debootstrap/scripts
-       // pointing release to definition.Source.Suite.
+       // pointing release to definition.Source.SameAs.
        scriptPath := filepath.Join("/usr/share/debootstrap/scripts", 
definition.Image.Release)
        if !lxd.PathExists(scriptPath) && definition.Source.SameAs != "" {
                err := os.Symlink(definition.Source.SameAs, scriptPath)
_______________________________________________
lxc-devel mailing list
lxc-devel@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-devel

Reply via email to