Every struct in a NodeConf with `lopt:"foo" set is now added as a
command-line flag with the RecursiveCreateFlags call. For maps a struct
with the key UNDEF is added so that it can be parsed out.
As the flags for the command-line need variables which hold the values,
for every map an element map[UNDEF] is added. When now calling the
internal add, these map element can be filtered out and replace by the
given name. (e.g., --netname)
* rewrote node/profile add for recursive functions
* rewrote node/profile set for recursive functions
* rewrote node/profile list for recursive functions
Signed-off-by: Christian Goll <cgoll@suse.com>
when transforming a NodeInfo struct to a NodeConf (set the NodeConf from
the NodeInfo) nested structures were seperately handled. This means a
there were seperate handles for e.g *Netdevs and *IpmiConfig. The new
getter traverses through the datastucture and sets the right value for a
Entry struct, but calls itself again if a Pointer is detected.
This adds the posiblity to add new nested structures to NodeConf and
NodeInfo without the need of seperately handling them in the transformer
functions.
Signed-off-by: Christian Goll <cgoll@suse.de>
When transforming a NodeConf struct to a NodeInfo (get the NodeInfo from
the Nodconf) nested structures were seperately handled. This means there
were seperate handles for e.g *Netdevs and *IpmiConfig. The new getter
traverses through the datastucture and sets the right value for an Entry
struct, but calls itself again if a Pointer is detected.
This adds the posiblity to add new nested structures to NodeConf and
NodeInfo without the need of seperate handling them in the transformer
functions.
Signed-off-by: Christian Goll <cgoll@suse.de>
Previously ephemeral container mounts were performed in /tmp. Now these
mounts are overlayed on the same fs as is used for chroots.
Signed-off-by: Christian Goll <cgoll@suse.com>
- Updated the linter from 1.50 to 1.53.2 because the previous version
was falling over (likely OOM).
- Updated protoc build command for newer version of protobuf.
The make command below should work now:
```shell
make clean setup proto all build wwapid wwapic wwapird ; echo $?
```
Signed-off-by: MatthewHink <matthew_hink@ciq.com>
Closes#840
* SyncUids can now return applicable errors even during showOnly, so
updated ContainerImport to ignore errors during showOnly.
* Fixed handling of file gids during SyncUids
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
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>
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>
Initialized could be interpreted to mean dynamically initialized as
well. This new name removes that ambiguity.
Signed-off-by: Jonathon Anderson <janderson@ciq.co>
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>
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>
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>
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>