From 89202bdda809aae627303abb19e5f3fcc2cd9a61 Mon Sep 17 00:00:00 2001 From: Achilleas Koutsou Date: Fri, 28 Oct 2022 19:54:12 +0200 Subject: [PATCH] manifest: don't add hostname stage if not specified Skip the hostname stage if the hostname option is an empty string. --- internal/manifest/os.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/internal/manifest/os.go b/internal/manifest/os.go index 9707bcad0..6f7926971 100644 --- a/internal/manifest/os.go +++ b/internal/manifest/os.go @@ -254,7 +254,9 @@ func (p *OS) serialize() osbuild.Pipeline { pipeline.AddStage(osbuild.NewKeymapStage(&osbuild.KeymapStageOptions{Keymap: *p.Keyboard})) } - pipeline.AddStage(osbuild.NewHostnameStage(&osbuild.HostnameStageOptions{Hostname: p.Hostname})) + if p.Hostname != "" { + pipeline.AddStage(osbuild.NewHostnameStage(&osbuild.HostnameStageOptions{Hostname: p.Hostname})) + } pipeline.AddStage(osbuild.NewTimezoneStage(&osbuild.TimezoneStageOptions{Zone: p.Timezone})) if len(p.NTPServers) > 0 {