- Remove global state
- Remove redundant data
- Remove unused functionality (e.g., file permissions)
- Separate directory creation from file writing
- Additional helper functions for file reading and cleanup
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
Signed-off-by: Christian Goll <cgoll@suse.com>
framework creates all the necessary configuration file for warewulf
under a temporary directory. Individual warewulf.conf and nodes.conf
can be provided.
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 recent PR #883 replaced the standard overlay naming convention with
static names for each of the runtime and wwinit/system contexts; but the
method by which it left the "legacy" naming convention in place led to a
bug where warewulfd was still attempting to serve overlays with the
previous naming convention, though this name wasn't being built.
This PR refactors contextual overlay image naming to be, I think, a more
typical golang pattern, and updates affected code to match.
This PR also included tests for all functions modified by this change.
Fixes#896
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
The recent `overlay edit` command reimplementation included some
incorrect ordering that led to spurious error messages for files that
did not yet exist. This reimplementation reorders operations to avoid
such error messages and clarifies the implementation by editing in a
temporary file and using mtime to discern whether an edit has occurred.
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
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>