Commit Graph

8 Commits

Author SHA1 Message Date
Jonathon Anderson
387cd0f7be Refactor BaseConf Read and Parse
Also refactor New and Get to return pointers to match BaseConf methods.
This makes calling the methods immediately on the return values of the
constructors easier.

Also move config.ConfigFile to buildconfig.go.in. ConfigFile is still
used by wwctl as a default config file to reference; but it is removed
from other locations now.

Removed Persist, as nothing called it.

Signed-off-by: Jonathon Anderson <janderson@ciq.co>
2023-04-19 14:02:43 -06:00
Jonathon Anderson
c461e65a98 Rename pkg/warewulfconf to pkg/config
Signed-off-by: Jonathon Anderson <janderson@ciq.co>
2023-04-19 14:02:43 -06:00
Jonathon Anderson
e693ca9cd4 Merge remote-tracking branch 'jason/issue/658' into development
Signed-off-by: Jonathon Anderson <janderson@ciq.co>
2023-04-16 18:43:59 -06:00
Jonathon Anderson
2319906d97 Fix writing of nodes.conf
The caching functionality of nodes.conf, and the optional persistence
functionality that came with it, appears to have been preventing
actually writing the configuration to disk in all cases. This change
fixes the ability to write to nodes.conf.

Somewhat opinionatedly, this change removes the caching functionality of
nodes.conf. The tests have also been updated to use real files for i/o
rather than tying into the caching system, making them more accurately
test the ability of Warewulf to actually read and write its
configuration.

Fixes #779

Signed-off-by: Jonathon Anderson <janderson@ciq.co>
2023-04-14 10:53:31 -06:00
Christian Goll
12e462afa1 added parsing tests
Signed-off-by: Christian Goll <cgoll@suse.de>
2023-03-23 11:17:54 +01:00
Christian Goll
2410a8194c wwctl node add without global variables
Signed-off-by: Christian Goll <cgoll@suse.de>
2023-03-23 11:11:01 +01:00
Christian Goll
4750f96cc6 main_tests are not working as expected
The global values which store the flags are not regenerated during test

Signed-off-by: Christian Goll <cgoll@suse.de>
2023-03-23 11:11:01 +01:00
Christian Goll
c1e2100322 added a test for wwctl node add
Signed-off-by: Christian Goll <cgoll@suse.de>
2023-03-23 11:10:29 +01:00