introduced wwbool and don't export
Nodes and NodeConfs. This requires new
explict Yaml (un)marshaling as the standard
marshaller won't touch these fields
Signed-off-by: Christian Goll <cgoll@suse.com>
This is a significant change in the undelying data model!
nodeDb, err := node.New()
will result in a structure which contains the on disk
values. Only
nodeDb.FindAllNodes() or nodeDb.GetNode(id) will give
the nodes with its merged in profiles.
Signed-off-by: Christian Goll <cgoll@suse.com>
This is needed for printing out the values, as at this part in the
code there is no access to the NodeConf and only there the information
if the Entry is ment as a slice or not is available.
Signed-off-by: Christian Goll <cgoll@suse.com>
Also the boot method is now configured globaly as this is
the only way to make sure that unkonwn nodes get the right
stuff
Signed-off-by: Christian Goll <cgoll@suse.com>
Primary network devices are now identified by a per-node attribute,
rather than a per-netdev boolean. While the legacy data can still be
parsed, the argument for setting the per-netdev boolean at the
command-line is no longer available.
Correct behavior is tested.
Signed-off-by: Christian Goll <cgoll@suse.com>
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>
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>
* 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>
Prior the primary was a boolean attribute of NetDev, so several
NetDevs could have been primay. Setting is as a sting in NodeConf
assures that only one network could be primary.
If no primary network is set, a valid altvalue will be set.
I noticed that some wwlog calls included a trailing newline, but others
did not. I tested both in isolation and discovered that the behavior was
consistent regardless of whether a trailing newline was included. I
further confirmed in code that wwlog appends a trailing newline
automatically if it is not present; so a trailing newline is unnecessary
in individual calls.
This commit removes trailing newlines from all calls to make them
consistent. It also replaces two calls to wwlog.Printf. (see #534)
Signed-off-by: Jonathon Anderson <janderson@ciq.co>
wwlog provides named loggers for each level, which requires
less code and is clearer than wwlog.Printf. The code has
included a mix of both, but this commit consolidates existing
code on the per-level functions.
Signed-off-by: Jonathon Anderson <janderson@ciq.co>