Refactor and document config/datastructure

Also adjusted case for initialisms (e.g., DHCP, TFTP, NFS).

Signed-off-by: Jonathon Anderson <janderson@ciq.co>
This commit is contained in:
Jonathon Anderson
2023-04-14 19:21:29 -06:00
parent cfdf179e16
commit 8321193645
15 changed files with 122 additions and 100 deletions

View File

@@ -18,7 +18,7 @@ func NFS() error {
controller := warewulfconf.Get()
if controller.Nfs.Enabled {
if controller.NFS.Enabled {
if controller.Warewulf.EnableHostOverlay {
err := overlay.BuildHostOverlay()
if err != nil {
@@ -28,13 +28,13 @@ func NFS() error {
wwlog.Info("host overlays are disabled, did not modify exports")
}
fmt.Printf("Enabling and restarting the NFS services\n")
if controller.Nfs.SystemdName == "" {
if controller.NFS.SystemdName == "" {
err := util.SystemdStart("nfs-server")
if err != nil {
return errors.Wrap(err, "failed to start nfs-server")
}
} else {
err := util.SystemdStart(controller.Nfs.SystemdName)
err := util.SystemdStart(controller.NFS.SystemdName)
if err != nil {
return errors.Wrap(err, "failed to start")
}