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

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) ===

From 0ee72fbdc8b0c8031c366fa23c51442cf7888374 Mon Sep 17 00:00:00 2001
From: whatagraph-evaldas
 <72733353+whatagraph-eval...@users.noreply.github.com>
Date: Sun, 8 Nov 2020 17:22:25 +0200
Subject: [PATCH] Update hostname.go

---
 generators/hostname.go | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/generators/hostname.go b/generators/hostname.go
index 136609c..999e3c3 100644
--- a/generators/hostname.go
+++ b/generators/hostname.go
@@ -71,10 +71,15 @@ 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{
+               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