From 68f62ed0a19df949626d48b6aaf471b98157383d Mon Sep 17 00:00:00 2001 From: Christian Goll Date: Wed, 13 Nov 2024 13:42:57 +0100 Subject: [PATCH] fix problem that tags don't show up in overlay Signed-off-by: Christian Goll --- CHANGELOG.md | 1 + internal/pkg/warewulfd/provision.go | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b7129c01..9df8e440 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -64,6 +64,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Replace `olekukonko/tablewriter` with `cheynewallace/tabby`. #1497, #1498 - replaced deprecated errors.Wrapf with fmr.Errorf. #1534 - Rename udev net naming file to 70-persistent-net.rules. #1227 +- Manage warewulfd template data as a pointer. #1548 ### Removed diff --git a/internal/pkg/warewulfd/provision.go b/internal/pkg/warewulfd/provision.go index 5a165a55..f332b7cf 100644 --- a/internal/pkg/warewulfd/provision.go +++ b/internal/pkg/warewulfd/provision.go @@ -71,7 +71,7 @@ func ProvisionSend(w http.ResponseWriter, req *http.Request) { var stage_file string // TODO: when module version is upgraded to go1.18, should be 'any' type - var tmpl_data interface{} + var tmpl_data *templateVars remoteNode, err := GetNodeOrSetDiscoverable(rinfo.hwaddr) if err != nil && err != node.ErrNoUnconfigured { @@ -91,13 +91,13 @@ func ProvisionSend(w http.ResponseWriter, req *http.Request) { wwlog.Error("%s (unknown/unconfigured node)", rinfo.hwaddr) if rinfo.stage == "ipxe" { stage_file = path.Join(conf.Paths.Sysconfdir, "/warewulf/ipxe/unconfigured.ipxe") - tmpl_data = templateVars{ + tmpl_data = &templateVars{ Hwaddr: rinfo.hwaddr} } } else if rinfo.stage == "ipxe" { stage_file = path.Join(conf.Paths.Sysconfdir, "warewulf/ipxe/"+remoteNode.Ipxe+".ipxe") - tmpl_data = templateVars{ + tmpl_data = &templateVars{ Id: remoteNode.Id(), Cluster: remoteNode.ClusterName, Fqdn: remoteNode.Id(), @@ -181,7 +181,7 @@ func ProvisionSend(w http.ResponseWriter, req *http.Request) { } case "grub.cfg": stage_file = path.Join(conf.Paths.Sysconfdir, "warewulf/grub/grub.cfg.ww") - tmpl_data = templateVars{ + tmpl_data = &templateVars{ Id: remoteNode.Id(), Cluster: remoteNode.ClusterName, Fqdn: remoteNode.Id(),