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

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) ===
Signed-off-by: Get OpenDroplet <getopendrop...@gmail.com>

Was skipped definition from config file.
From 519d77577ead7cd3023b58b02d09a9784b357543 Mon Sep 17 00:00:00 2001
From: Get OpenDroplet <getopendrop...@gmail.com>
Date: Thu, 12 Nov 2020 18:58:11 +0200
Subject: [PATCH] Added missing definitions in generators hosts, hostname

Signed-off-by: Get OpenDroplet <getopendrop...@gmail.com>
---
 generators/hostname.go | 11 ++++++++---
 generators/hosts.go    | 11 ++++++++---
 2 files changed, 16 insertions(+), 6 deletions(-)

diff --git a/generators/hostname.go b/generators/hostname.go
index 136609c..7bf07f5 100644
--- a/generators/hostname.go
+++ b/generators/hostname.go
@@ -70,11 +70,16 @@ func (g HostnameGenerator) RunLXD(cacheDir, sourceDir 
string, img *image.LXDImag
 
        // Add to LXD templates
        img.Metadata.Templates[defFile.Path] = &api.ImageMetadataTemplate{
-               Template: "hostname.tpl",
-               When: []string{
+               Template:   "hostname.tpl",
+               Properties: defFile.Template.Properties,
+               When:       defFile.Template.When,
+       }
+
+       if len(defFile.Template.When) == 0 {
+               img.Metadata.Templates[defFile.Path].When = []string{
                        "create",
                        "copy",
-               },
+               }
        }
 
        return err
diff --git a/generators/hosts.go b/generators/hosts.go
index b4ac000..4e41e88 100644
--- a/generators/hosts.go
+++ b/generators/hosts.go
@@ -92,11 +92,16 @@ func (g HostsGenerator) RunLXD(cacheDir, sourceDir string, 
img *image.LXDImage,
        }
 
        img.Metadata.Templates[defFile.Path] = &api.ImageMetadataTemplate{
-               Template: "hosts.tpl",
-               When: []string{
+               Template:   "hosts.tpl",
+               Properties: defFile.Template.Properties,
+               When:       defFile.Template.When,
+       }
+
+       if len(defFile.Template.When) == 0 {
+               img.Metadata.Templates[defFile.Path].When = []string{
                        "create",
                        "copy",
-               },
+               }
        }
 
        return err
_______________________________________________
lxc-devel mailing list
lxc-devel@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-devel

Reply via email to