Fixing tests in review of #1568

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
This commit is contained in:
Jonathon Anderson
2025-01-17 00:58:12 -07:00
parent 847d11611b
commit eff1edd038
27 changed files with 90 additions and 98 deletions

View File

@@ -37,7 +37,7 @@ type TemplateStruct struct {
Tftp warewulfconf.TFTPConf
Paths warewulfconf.BuildConfig
AllNodes []node.Node
Resource map[string]node.RemoteRes
Resources map[string]node.Resource
node.Node
// backward compatiblity
Container string
@@ -47,7 +47,7 @@ type TemplateStruct struct {
/*
Initialize an TemplateStruct with the given node.NodeInfo
*/
func InitStruct(overlayName string, nodeData node.Node, allNodes []node.Node) (TemplateStruct, error) {
func InitStruct(overlayName string, nodeData node.Node, allNodes []node.Node, resources map[string]node.Resource) (TemplateStruct, error) {
var tstruct TemplateStruct
tstruct.Overlay = overlayName
hostname, _ := os.Hostname()
@@ -82,7 +82,7 @@ func InitStruct(overlayName string, nodeData node.Node, allNodes []node.Node) (T
tstruct.BuildTime = dt.Format("01-02-2006 15:04:05 MST")
tstruct.BuildTimeUnix = strconv.FormatInt(dt.Unix(), 10)
// tstruct.Node.Tags = map[string]string{}
tstruct.Resource = nodeDB.Resource
tstruct.Resources = resources
var buf bytes.Buffer
enc := gob.NewEncoder(&buf)
dec := gob.NewDecoder(&buf)