Commit Graph

1005 Commits

Author SHA1 Message Date
jason yang
b5b62206c1 add one more case
Signed-off-by: jason yang <jasonyangshadow@gmail.com>
2023-05-09 06:12:31 +00:00
jason yang
59390b4dda node/profile list syntax doesn't support comma-separated values
Signed-off-by: jason yang <jasonyangshadow@gmail.com>
2023-05-09 05:30:35 +00:00
Jonathon Anderson
ab52e389f6 Merge pull request #781 from anderbubble/config-refactor
Refactor package that handles warewulf.conf
2023-04-26 13:56:03 -06:00
Christian Goll
8b552fe5ca make onboot default for network devices
Signed-off-by: Christian Goll <cgoll@suse.de>
2023-04-21 08:38:15 +02:00
Jonathon Anderson
62018eedf0 Fix a failing unit test after a rebase
Signed-off-by: Jonathon Anderson <janderson@ciq.co>
2023-04-19 14:05:24 -06:00
Jonathon Anderson
5923130676 Add tests for config
Signed-off-by: Jonathon Anderson <janderson@ciq.co>
2023-04-19 14:02:43 -06:00
Jonathon Anderson
4622153a82 Support subdirectories in ipxe paths
Signed-off-by: Jonathon Anderson <janderson@ciq.co>
2023-04-19 14:02:43 -06:00
Jonathon Anderson
e2e3a90623 Revert some caps changes
Use in templates means these were an accidental interface change.

Signed-off-by: Jonathon Anderson <janderson@ciq.co>
2023-04-19 14:02:43 -06:00
Jonathon Anderson
82520c0de0 Fix linter errors in some tests
Signed-off-by: Jonathon Anderson <janderson@ciq.co>
2023-04-19 14:02:43 -06:00
Jonathon Anderson
8321193645 Refactor and document config/datastructure
Also adjusted case for initialisms (e.g., DHCP, TFTP, NFS).

Signed-off-by: Jonathon Anderson <janderson@ciq.co>
2023-04-19 14:02:43 -06:00
Jonathon Anderson
cfdf179e16 Remove SetDynamicDefaults from Parse
Signed-off-by: Jonathon Anderson <janderson@ciq.co>
2023-04-19 14:02:43 -06:00
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
a10fdb3808 Remove config.DataStore()
Comments in the code were already disparaging of config.DataStore(), but
implied that its presence made other code more readable. It was only
used in two places and, imo, how I've refactored it is more explicit and
clear than it was.

Signed-off-by: Jonathon Anderson <janderson@ciq.co>
2023-04-19 14:02:43 -06:00
Jonathon Anderson
af6c91ade3 Rename BaseConf.Initialized to BaseConf.InitializedFromFile
Initialized could be interpreted to mean dynamically initialized as
well. This new name removes that ambiguity.

Signed-off-by: Jonathon Anderson <janderson@ciq.co>
2023-04-19 14:02:43 -06:00
Jonathon Anderson
70292276e2 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>
2023-04-19 14:02:43 -06:00
Jonathon Anderson
f78e6b73b1 Rename ControllerConf to BaseConfig
Also moved BaseConfig to a new source file, co-located with its
constructors and methods, and added doc comments.

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
b6e6795dee Removed "glob" from node pattern description
A glob is a pattern that supports * and ? wildcards. This is not
supported for node patterns. I'd call these "hostlist" patterns; but
easier to just leave it generic for now until and unless there is
documentation to refer to on the website about the pattern type.

Signed-off-by: Jonathon Anderson <janderson@ciq.co>
2023-04-16 20:58:39 -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
cc714008ef Add doc comments for two methods
Signed-off-by: Jonathon Anderson <janderson@ciq.co>
2023-04-16 07:24:14 -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
jason yang
d73a6f269c fix the code
Signed-off-by: jason yang <jasonyangshadow@gmail.com>
2023-04-12 12:04:53 +00:00
jason yang
7500688f82 merge the latest development
Signed-off-by: jason yang <jasonyangshadow@gmail.com>
2023-04-12 10:29:35 +00:00
jason yang
0faada6aae refactor the profile add
Signed-off-by: jason yang <jasonyangshadow@gmail.com>
2023-04-12 10:27:44 +00:00
Christian Goll
0f2fcb326f Merge pull request #670 from mslacken/FixProfileAdd
correct behavior of profile add to yes flag
2023-04-12 08:58:10 +02:00
jason yang
db048bfa73 update the main_test to ignore time zone
Signed-off-by: jason yang <jasonyangshadow@gmail.com>
2023-04-12 06:26:51 +00:00
Christian Goll
5f5724c8a9 Merge branch 'development' into RefactorFlags 2023-04-11 14:17:13 +02:00
Christian Goll
48c08f3fd7 Merge pull request #719 from hpcng/hashConf
more secure edit command
2023-04-11 11:44:01 +02:00
jason yang
fd768145a9 add test case for container list
Signed-off-by: jason yang <jasonyangshadow@gmail.com>
2023-03-29 12:44:12 +00:00
jason yang
6dcd26322a add test case for profile list
Signed-off-by: jason yang <jasonyangshadow@gmail.com>
2023-03-29 10:35:17 +00:00
Christian Goll
7265083ed0 added test for node list
Signed-off-by: Christian Goll <cgoll@suse.com>
2023-03-28 20:56:12 +02:00
jason yang
6f200d65a6 Merge branch 'development' into issue/690 2023-03-28 07:09:33 +00:00
Christian Goll
c476ba8ec4 hash checking for profile edit
Signed-off-by: Christian Goll <cgoll@suse.de>
2023-03-24 19:47:22 +01:00
Christian Goll
b4acf0fdf2 added hash check for node edit
Signed-off-by: Christian Goll <cgoll@suse.de>
2023-03-24 19:47:22 +01:00
Christian Goll
ee4f9d53d6 add hash function
Signed-off-by: Christian Goll <cgoll@suse.de>
2023-03-24 19:47:22 +01:00
Christian Goll
4582a1f59e fix linting for disabled batch test
Signed-off-by: Christian Goll <cgoll@suse.de>
2023-03-24 19:47:22 +01:00
Christian Goll
aee7738be1 fix linting for disabled batch test
Signed-off-by: Christian Goll <cgoll@suse.de>
2023-03-24 09:52:38 +01:00
Jonathon Anderson
132f14c4c3 Disable TestBatchPool
This test is unreliable due to its dependency on timing. Disabling for now
until a better method is implemented.

Signed-off-by: Jonathon Anderson <janderson@ciq.co>
2023-03-23 12:14:36 -06:00
Christian Goll
366113bf65 Merge branch 'RefactorFlags' into development
Signed-off-by: Christian Goll <cgoll@suse.de>
2023-03-23 11:24:47 +01: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
e27ee11f16 fixed wrong converter for bools
Signed-off-by: Christian Goll <cgoll@suse.de>
2023-03-23 11:17:54 +01:00
Christian Goll
96644be621 allow UNSET for IP addresses
added more tests for GetFrom
allow UNSET and handle empty hwaddr

Signed-off-by: Christian Goll <cgoll@suse.de>
2023-03-23 11:17:38 +01:00
Christian Goll
b0602133ec use netParseIP and ParseMAC
check also MAC addresses and common formating

Signed-off-by: Christian Goll <cgoll@suse.de>

reformat ipaddr for test coverage

fixed processing of default values

updated transformer tests

correct behavior for tags

add tests for tags

new tests for primary network

Signed-off-by: Christian Goll <cgoll@suse.de>
2023-03-23 11:17:07 +01:00
Christian Goll
c14dd3c6d1 check the yaml direclty after unmarshalling 2023-03-23 11:15:50 +01:00
Christian Goll
13bc378a6b Refactor the CreateFlags command
* added the additional type flag, which can be bool,IP
* UNDEF is recognized for the bool flag
* 0.0.0.0 must be used as UNDEF for IP flag

Signed-off-by: Christian Goll <cgoll@suse.de>
2023-03-23 11:15:50 +01:00
Christian Goll
09d14039b0 added Changelog
Signed-off-by: Christian Goll <cgoll@suse.de>
2023-03-23 11:15:44 +01:00
Christian Goll
70361425ff generate man pages via sub command
Signed-off-by: Christian Goll <cgoll@suse.de>
2023-03-23 11:11:01 +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
b00a619746 moved location of defaults.conf
Signed-off-by: Christian Goll <cgoll@suse.de>
2023-03-23 11:10:58 +01:00