Rename BaseConf.New to BaseConf.Get
Since BaseConf.New could return a cached BaseConf, rather than always constructing a new struct, I've renamed it to Get to more accurately reflect its use. A new New() method is called by Get and always initializes a new struct. Signed-off-by: Jonathon Anderson <janderson@ciq.co>
This commit is contained in:
@@ -61,7 +61,7 @@ func DaemonInitLogging() error {
|
||||
wwlog.SetLogLevel(wwlog.SERV)
|
||||
}
|
||||
|
||||
conf := warewulfconf.New()
|
||||
conf := warewulfconf.Get()
|
||||
|
||||
if conf.Warewulf.Syslog {
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ type iPxeTemplate struct {
|
||||
}
|
||||
|
||||
func ProvisionSend(w http.ResponseWriter, req *http.Request) {
|
||||
conf := warewulfconf.New()
|
||||
conf := warewulfconf.Get()
|
||||
|
||||
rinfo, err := parseReq(req)
|
||||
if err != nil {
|
||||
|
||||
@@ -58,7 +58,7 @@ func RunServer() error {
|
||||
http.HandleFunc("/overlay-runtime/", ProvisionSend)
|
||||
http.HandleFunc("/status", StatusSend)
|
||||
|
||||
conf := warewulfconf.New()
|
||||
conf := warewulfconf.Get()
|
||||
|
||||
daemonPort := conf.Warewulf.Port
|
||||
wwlog.Serv("Starting HTTPD REST service on port %d", daemonPort)
|
||||
|
||||
Reference in New Issue
Block a user