Initial wwctl upgrade command

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
This commit is contained in:
Jonathon Anderson
2024-11-05 12:03:03 -07:00
parent 336577c221
commit 981d11a012
5 changed files with 68 additions and 7 deletions

View File

@@ -18,14 +18,17 @@ var (
ConfigFile string
)
/*
Creates a new nodeDb object from the on-disk configuration
*/
func New() (NodesYaml, error) {
func init() {
conf := warewulfconf.Get()
if ConfigFile == "" {
ConfigFile = path.Join(conf.Paths.Sysconfdir, "warewulf/nodes.conf")
}
}
/*
Creates a new nodeDb object from the on-disk configuration
*/
func New() (NodesYaml, error) {
wwlog.Verbose("Opening node configuration file: %s", ConfigFile)
data, err := os.ReadFile(ConfigFile)
if err != nil {