From e117464f50384654432109e5bf8ce45060d13cb4 Mon Sep 17 00:00:00 2001 From: Christian Goll Date: Fri, 3 Mar 2023 16:12:53 +0100 Subject: [PATCH] paths need to be visibale for marshalling Signed-off-by: Christian Goll --- internal/pkg/overlay/datastructure.go | 1 + internal/pkg/warewulfconf/buildconfig.go.in | 28 +++++------ internal/pkg/warewulfconf/datastructure.go | 2 +- internal/pkg/warewulfconf/getter.go | 56 ++++++++++----------- 4 files changed, 44 insertions(+), 43 deletions(-) diff --git a/internal/pkg/overlay/datastructure.go b/internal/pkg/overlay/datastructure.go index f02bdedc..c7da9a70 100644 --- a/internal/pkg/overlay/datastructure.go +++ b/internal/pkg/overlay/datastructure.go @@ -32,6 +32,7 @@ type TemplateStruct struct { Nfs warewulfconf.NfsConf Warewulf warewulfconf.WarewulfConf Tftp warewulfconf.TftpConf + Paths warewulfconf.BuildConfig AllNodes []node.NodeInfo node.NodeConf // backward compatiblity diff --git a/internal/pkg/warewulfconf/buildconfig.go.in b/internal/pkg/warewulfconf/buildconfig.go.in index 7bdf96e1..3a5a52cd 100644 --- a/internal/pkg/warewulfconf/buildconfig.go.in +++ b/internal/pkg/warewulfconf/buildconfig.go.in @@ -1,18 +1,18 @@ package warewulfconf type BuildConfig struct { - bindir string `default:"@BINDIR@"` - sysconfdir string `default:"@SYSCONFDIR@"` - datadir string `default:"@DATADIR@"` - localstatedir string `default:"@LOCALSTATEDIR@"` - srvdir string `default:"@SRVDIR@"` - tftpdir string `default:"@TFTPDIR@"` - firewallddir string `default:"@FIREWALLDDIR@"` - systemddir string `default:"@SYSTEMDDIR@"` - wwoverlaydir string `default:"@WWOVERLAYDIR@"` - wwchrootdir string `default:"@WWCHROOTDIR@"` - wwprovisiondir string `default:"@WWPROVISIONDIR@"` - version string `default:"@VERSION@"` - release string `default:"@RELEASE@"` - wwclientdir string `default:"@WWCLIENTDIR@"` + Bindir string `default:"@BINDIR@"` + Sysconfdir string `default:"@SYSCONFDIR@"` + Datadir string `default:"@DATADIR@"` + Localstatedir string `default:"@LOCALSTATEDIR@"` + Srvdir string `default:"@SRVDIR@"` + Tftpdir string `default:"@TFTPDIR@"` + Firewallddir string `default:"@FIREWALLDDIR@"` + Systemddir string `default:"@SYSTEMDDIR@"` + Wwoverlaydir string `default:"@WWOVERLAYDIR@"` + Wwchrootdir string `default:"@WWCHROOTDIR@"` + Wwprovisiondir string `default:"@WWPROVISIONDIR@"` + Version string `default:"@VERSION@"` + Release string `default:"@RELEASE@"` + Wwclientdir string `default:"@WWCLIENTDIR@"` } diff --git a/internal/pkg/warewulfconf/datastructure.go b/internal/pkg/warewulfconf/datastructure.go index 33d77fe2..4c4ae71b 100644 --- a/internal/pkg/warewulfconf/datastructure.go +++ b/internal/pkg/warewulfconf/datastructure.go @@ -18,7 +18,7 @@ type ControllerConf struct { Tftp *TftpConf `yaml:"tftp"` Nfs *NfsConf `yaml:"nfs"` MountsContainer []*MountEntry `yaml:"container mounts" default:"[{\"source\": \"/etc/resolv.conf\", \"dest\": \"/etc/resolv.conf\"}]"` - Paths *BuildConfig `yaml:"mypaths"` + Paths *BuildConfig `yaml:"paths"` current bool } diff --git a/internal/pkg/warewulfconf/getter.go b/internal/pkg/warewulfconf/getter.go index 6a3f5a01..6d92a2fe 100644 --- a/internal/pkg/warewulfconf/getter.go +++ b/internal/pkg/warewulfconf/getter.go @@ -3,71 +3,71 @@ package warewulfconf import "github.com/hpcng/warewulf/internal/pkg/wwlog" func (conf *ControllerConf) BINDIR() string { - wwlog.Debug("BINDIR = '%s'", conf.Paths.bindir) - return conf.Paths.bindir + wwlog.Debug("BINDIR = '%s'", conf.Paths.Bindir) + return conf.Paths.Bindir } func (conf *ControllerConf) DATADIR() string { - wwlog.Debug("DATADIR = '%s'", conf.Paths.datadir) - return conf.Paths.datadir + wwlog.Debug("DATADIR = '%s'", conf.Paths.Datadir) + return conf.Paths.Datadir } func (conf *ControllerConf) SYSCONFDIR() string { - wwlog.Debug("SYSCONFDIR = '%s'", conf.Paths.sysconfdir) - return conf.Paths.sysconfdir + wwlog.Debug("SYSCONFDIR = '%s'", conf.Paths.Sysconfdir) + return conf.Paths.Sysconfdir } func (conf *ControllerConf) LOCALSTATEDIR() string { - wwlog.Debug("LOCALSTATEDIR = '%s'", conf.Paths.localstatedir) - return conf.Paths.localstatedir + wwlog.Debug("LOCALSTATEDIR = '%s'", conf.Paths.Localstatedir) + return conf.Paths.Localstatedir } func (conf *ControllerConf) SRVDIR() string { - wwlog.Debug("SRVDIR = '%s'", conf.Paths.srvdir) - return conf.Paths.srvdir + wwlog.Debug("SRVDIR = '%s'", conf.Paths.Srvdir) + return conf.Paths.Srvdir } func (conf *ControllerConf) TFTPDIR() string { - wwlog.Debug("TFTPDIR = '%s'", conf.Paths.tftpdir) - return conf.Paths.tftpdir + wwlog.Debug("TFTPDIR = '%s'", conf.Paths.Tftpdir) + return conf.Paths.Tftpdir } func (conf *ControllerConf) FIREWALLDDIR() string { - wwlog.Debug("FIREWALLDDIR = '%s'", conf.Paths.firewallddir) - return conf.Paths.firewallddir + wwlog.Debug("FIREWALLDDIR = '%s'", conf.Paths.Firewallddir) + return conf.Paths.Firewallddir } func (conf *ControllerConf) SYSTEMDDIR() string { - wwlog.Debug("SYSTEMDDIR = '%s'", conf.Paths.systemddir) - return conf.Paths.systemddir + wwlog.Debug("SYSTEMDDIR = '%s'", conf.Paths.Systemddir) + return conf.Paths.Systemddir } func (conf *ControllerConf) WWOVERLAYDIR() string { - wwlog.Debug("WWOVERLAYDIR = '%s'", conf.Paths.wwoverlaydir) - return conf.Paths.wwoverlaydir + wwlog.Debug("WWOVERLAYDIR = '%s'", conf.Paths.Wwoverlaydir) + return conf.Paths.Wwoverlaydir } func (conf *ControllerConf) WWCHROOTDIR() string { - wwlog.Debug("WWCHROOTDIR = '%s'", conf.Paths.wwchrootdir) - return conf.Paths.wwchrootdir + wwlog.Debug("WWCHROOTDIR = '%s'", conf.Paths.Wwchrootdir) + return conf.Paths.Wwchrootdir } func (conf *ControllerConf) WWPROVISIONDIR() string { - wwlog.Debug("WWPROVISIONDIR = '%s'", conf.Paths.wwprovisiondir) - return conf.Paths.wwprovisiondir + wwlog.Debug("WWPROVISIONDIR = '%s'", conf.Paths.Wwprovisiondir) + return conf.Paths.Wwprovisiondir } func (conf *ControllerConf) VERSION() string { - wwlog.Debug("VERSION = '%s'", conf.Paths.version) - return conf.Paths.version + wwlog.Debug("VERSION = '%s'", conf.Paths.Version) + return conf.Paths.Version } func (conf *ControllerConf) RELEASE() string { - wwlog.Debug("RELEASE = '%s'", conf.Paths.release) - return conf.Paths.release + wwlog.Debug("RELEASE = '%s'", conf.Paths.Release) + return conf.Paths.Release } func (conf *ControllerConf) WWCLIENTDIR() string { - wwlog.Debug("WWCLIENTDIR = '%s'", conf.Paths.wwclientdir) - return conf.Paths.wwclientdir + wwlog.Debug("WWCLIENTDIR = '%s'", conf.Paths.Wwclientdir) + return conf.Paths.Wwclientdir }